12.02.2017, 11:17
(Help) how to make command give gun but without id 38
CMD:deserteagle(playerid,params[])
{
GivePlayerWeapon(playerid, 24);
return 1;
}
CMD:mycommand(playerid,params[])
{
//do something here
return 1;
}
CMD:sawnoff(playerid,params[])
{
GivePlayerWeapon(playerid,26);
return 1;
}
CMD:givegun(playerid, params[]){
new pid, wid, ammo, str[128], pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000, "ERROR: You can't use this command");
if(sscanf(params, "uii", pid, wid, ammo)) return SendClientMessage(playerid, -1, "USAGE: /givegun [player id] [weapon id] [ammo]");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, 0xFF0000, "ERROR: Player is not cnnected");
if(wid == 38) return SendClientMessage(playerid, 0xFF0000, "ERROR: weapond id 38 is forbidden");
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(pid, tName, sizeof(tName));
GivePlayerWeapon(pid, wid, ammo);
format(str, sizeof(str), "Administrator %s has given %s %w with %d ammo",pName, tName, wid, ammo);
SendClientMessageToAll(0xFF00FF, str);
return 1;
}