Help with command
#1

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

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;
}

Reply
#3

Thanks.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)