SA-MP Forums Archive
Help with command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with command (/showthread.php?tid=124594)



Help with command - Lorenc_ - 31.01.2010

Код:
dcmd_rims(playerid,params[])
{
	#pragma unused params
 	ShowMenuForPlayer(tune,playerid);
  TogglePlayerControllable(playerid, 0);
	return 1;
}
How could i make this command work only if your in a vehicle otherwise it would send you a error message saying 'Error: you have to be in a vehicle to use this command'.

please help


Re: Help with command - [HiC]TheKiller - 31.01.2010

pawn Код:
dcmd_rims(playerid,params[])
{
    #pragma unused params
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR, "You are not in a vehicle");
    ShowMenuForPlayer(tune,playerid);
  TogglePlayerControllable(playerid, 0);
    return 1;
}




Re: Help with command - Lorenc_ - 31.01.2010

Thanks.


Re: Help with command - bluray - 31.01.2010

change that to :
Код:
 if(!GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR, "You are not the driver");
otherwise the passenger will change things in the car.