CMD:giveweapon(playerid, params[]) { if (!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, -1, "SERVER: Unknown command."); } else if (IsPlayerAdmin(playerid)) { GivePlayerWeapon(playerid, weaponid, 6000); } if (!IsPlayerLoggedIn(playerb)) { SendClientMessage(playerid, COLOR_WARN, "Invalid player id"); } if (weapon < 4 || weapon > 41) { SendClientMessage(playerid, COLOR_WARN, "Weapons are between id 4 and 41"); } return 1; } |
I need help with this command
I want that if a admin types /giveweapon that he can gives a weapon to a random player. and also I want as USAGE "USAGE:/Giveweapon [ID] [IDofWeapon] [AMOUNT]" Just take my code and improve it |
CMD:giveweap(playerid, params[])
{
new id, weap , ammo;
else if (sscanf(params, "udd", id, weap , ammo))
SendClientMessage(playerid, -1, "USAGE: /giveweap [ playerid ] [ weaponid ] [ ammo ]");
else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player Is Not Connected!");
else
{
GivePlayerWeapon(id , weap , ammo)
SendClientMessage(playerid, COLOR_GREEN, "You Gave A Gun To A Player.");
}
return 1;
}