23.02.2018, 11:34
I hope i helped u, i didn't test the code.
Код:
CMD:w(playerid, params[]) { new weapid, recieverid, ammo; if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GRAY, "You are not authorized to use that command!"); if(sscanf(params, "diu", weapid, ammo, recieverid)) { if (weapid < 0 || weapid > 46) return SendClientMessage(playerid, COLOR_GRAY, "Invalid weapon ID!"); GivePlayerWeapon(playerid, weapid, ammo); } else if(!sscanf(params, "diu", weapid, ammo, recieverid)) { if(IsPlayerConnected(recieverid)) { if(weapid < 0 || weapid > 46) return SendClientMessage(playerid, COLOR_GRAY, "Invalid weapon ID!"); GivePlayerWeapon(recieverid, weapid, ammo); } } else return SendClientMessage(playerid, COLOR_WHITE,"Usage: /w [WeapID] [Ammo] [PlayerID(Optional)]"); return 1; }