07.09.2010, 09:45
Learn to use zcmd and sscanf and the commands get alot simpler heres another quick command i made.
pawn Код:
COMMAND:giveweapon(playerid,paams[])
{
new pid, wid, amt;
if(sscanf(params,"udd",pid,wid,amt))return SendClientMessage(playerid,0xff0000FF,"ERROR: Usage /giveweapon [playerid/name][weaponid][ammo]");
if(wid < 0 || wid >40)return SendClientMessage(playerid,0xff0000FF,"ERROR: Invalid weaponid");
if(pid != INVALID_PLAYER_ID && IsPlayerConnected(pid))
{
if(IsPlayerAdmin(playerid))
{
GivePlayerWeapon(pid,wid,amt);
}
else SendClientMessage(playerid,0xff0000FF,"ERROR: You don't have permission to use that command");
}
else SendClientMessage(playerid,0xff0000FF,"ERROR: Player not found");
return 1;
}

