01.02.2018, 10:29
So players can spam the chat with the engine on/off key bind.
how can i mute a player if he spam pressing 2?
this is the code.
how can i mute a player if he spam pressing 2?
this is the code.
PHP код:
if ((newkeys==KEY_SUBMISSION))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are not driving any car.");
new string2[128];
new vehid = GetPlayerVehicleID(playerid);
if(IsABike(vehid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You can't turn on engine on a bike!");
if(Gas[vehid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: This vehicle doesn't have fuel.");
new e,l,a,d,b,bo,o;
GetVehicleParamsEx(vehid,e,l,a,d,b,bo,o);
new name[25];
GetPlayerName(playerid, name, sizeof(name));
if(e == 0)
{
SetVehicleParamsEx(vehid,1,l,a,d,b,bo,o);
format(string2, sizeof(string2), "* %s turns on the engine of %s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
ProxDetector(30.0, playerid, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SetVehicleParamsEx(vehid,0,l,a,d,b,bo,o);
format(string2, sizeof(string2), "* %s turns off the engine of%s.", name,vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
ProxDetector(30.0, playerid, string2, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}