SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 28/03/2010, 09:20 PM   #1
[Sk]Noob
Big Clucker
 
Join Date: May 2009
Posts: 102
Reputation: 0
Default [Help] Command

Hello,
I am using the following car system:
http://forum.sa-mp.com/index.php?topic=160633.0

I edited it to my GM and i have this command

if the player owns the car it will turn on the engine and if he dont, it wont.

Any ways i got the public vehicles on the GM too (LSPD,EMT,ETC..) and they're not buyable so when i try to /engine it says i dont own the vehicle. How can i fix it ?

Code:
if(strcmp(cmd, "/engine", true) == 0)
	{
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		{
		if(!strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
		{
		SendClientMessage(playerid,COLOR_VEH,"This is not your car!");
		return 1;
		}
 		if(EngineStatus[GetPlayerVehicleID(playerid)] == 0)
			{
			TogglePlayerControllable(playerid,1);
			EngineStatus[GetPlayerVehicleID(playerid)] = 1;
			if(PlayerInfo[playerid][pSex] == 1)
			{
			PlayerActionMessage(playerid,15.0,"turns on his vehicle's engine.");
			}
			else
			{
			PlayerActionMessage(playerid,15.0,"turns on her vehicle's engine.");
			}
			}
			else
			{
			TogglePlayerControllable(playerid,0);
			EngineStatus[GetPlayerVehicleID(playerid)] = 0;
			if(PlayerInfo[playerid][pSex] == 1)
				{
	  			PlayerActionMessage(playerid,15.0,"turns off his vehicle's engine.");
	  			}
	  			else
	  			{
				PlayerActionMessage(playerid,15.0,"turns off her vehicle's engine.");
	  			}
			}
		}
		else
		{
   	SendClientMessage(playerid,COLOR_VEH,"You are not in a car!");
		}
		return 1;
		}
[Sk]Noob is offline  
Old 28/03/2010, 09:38 PM   #2
RyDeR`
High-roller
 
RyDeR`'s Avatar
 
Join Date: Feb 2009
Location: Belgium
Posts: 2,929
Reputation: 700
Default Re: [Help] Command

Create an extra variable as boolean. Then use true ol false in your code..
__________________

Sup?
RyDeR` is offline  
Old 28/03/2010, 09:42 PM   #3
[Sk]Noob
Big Clucker
 
Join Date: May 2009
Posts: 102
Reputation: 0
Default Re: [Help] Command

whats boolean ? lol i dont understand english very good..
[Sk]Noob is offline  
Old 28/03/2010, 09:48 PM   #4
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 2,837
Reputation: 671
Default Re: [Help] Command

That would be a boolean variable (maybe check the sa-mp wiki, too)

pawn Code:
new bool:variable;


But I got a good suggestion

Let the script where it was and use it like it was as filterscript
I dont see the use of implanting other codes if there is the easier way
Nero_3D is online now  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Command Bugged] Each time i use /respawnallcars it says Unknown Command Rand_Omar Scripting Help 11 30/09/2012 01:35 AM
how i change wrong command (unknow command) OmarEco Help Archive 10 22/06/2010 05:09 PM
SERVER: Unknown Command when using a scripted command and it does execute! Moustafa Help Archive 6 11/06/2010 02:34 PM
Command that returns SERVER: Unknown Command. pagie1111 Help Archive 11 11/04/2010 10:55 AM
Command added but returns Unkown command hipy Help Archive 3 19/11/2009 06:11 PM


All times are GMT. The time now is 04:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.