08.01.2015, 23:32
pawn Код:
CMD:lock(playerid, params[])
{
if(sscanf(params, "u", params[0])) return SendClientMessage(playerid,Red,"Lock vehicle: /lock <id>");
if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,Red,"Player is not connected");
if(!IsPlayerInAnyVehicle(params[0])) return SendClientMessage(playerid,Red,"Player not in vehicle");
GetPlayerName(params[0], name,sizeof(name));
format(str,sizeof(str),"Vehicle: LOCKED FOR %s", name);
SendClientMessage(playerid, Red, str);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(i != params[0])
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(params[0]), i, 0, 1);
}
}
}
return true;
}