28.05.2018, 22:46
PHP код:
new HasSupp[MAX_PLAYERS]; // on top of the script.
OnPlayerConnect(playerid)
{
HasSupp[playerid] = 0;
return 1;
}
OnPlayerDisconnect(playerid)
{
HasSupp[playerid] = 0;
return 1;
}
CMD:suppressor(playerid, params[])
{
SendClientMessage(playerid, COLOR_AQUA, "You have been given a suppressor");
HasSupp[playerid] = 1;
return 1;
}
CMD:attachsupp(playerid, params[])
{
if(HasSupp[playerid] == 0) return SendClientMessage(playerid, COLOR_AQUA, "You don't have a suppressor");
if(GetPlayerWeapon(playerid) == 22)
{
GivePlayerWeapon(playerid, 23, 100);
GivePlayerWeapon(playerid, 22, 0);
}
SendClientMessage(playerid, COLOR_AQUA, "Attached the suppressor!");
else {
SendClientMessage(playerid, COLOR_AQUA, "You don't have a colt 45"); }
return 1;
}