[Help] Command
#1

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 ?

Код:
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;
		}
Reply
#2

Create an extra variable as boolean. Then use true ol false in your code..
Reply
#3

whats boolean ? lol i dont understand english very good..
Reply
#4

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

pawn Код:
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)