COMMAND:giveweapon(playerid, params[]) { if(!adminLevel(playerid, 3)) return 0; new otherID, msg[128], weaponid; if(sscanf(params, "ud", otherID, weaponid)) { Usage(playerid, "giveweapon <playerid> <weaponid>"); } else { if(!Player[playerid][onDuty]) { Server(playerid, "You must be on duty admin."); return 1; } if(isMe(playerid, otherID)) { Server(playerid, "You can't use this command to yourself."); } else { if(!isConnected(otherID)) { Server(playerid, "That player isn't logged in!"); return 1; } if(isHigher(playerid, otherID)) Server(playerid, "You can't use this command to that player."); else { format(msg, sizeof(msg), "give %s a weapon(%d).", GetName(otherID), weaponid); changeAlog(playerid, msg); GivePlayerWeapon(otherID, weaponid, 9999999); format(msg, sizeof(msg), "Administrator give you a weapon."); Server(otherID, msg); format(msg, sizeof(msg), "You have given "CHAT_YELLOW"%s(%d)"CHAT_WHITE" weapon(%d).", GetName(otherID), otherID, weaponid); Server(playerid, msg); } } } return 1; }
if(!Player[playerid][onDuty]) { Server(playerid, "You must be on duty admin."); return 1; } if(isMe(playerid, otherID)) { Server(playerid, "You can't use this command to yourself."); } |
if(!isConnected(otherID))
{
Server(playerid, "That player isn't logged in!");
return 1;
}
if(isHigher(playerid, otherID))
Server(playerid, "You can't use this command to that player.");
else
{
format(msg, sizeof(msg), "give %s a weapon(%d).", GetName(otherID), weaponid);
changeAlog(playerid, msg);
GivePlayerWeapon(otherID, weaponid, 9999999);
format(msg, sizeof(msg), "Administrator give you a weapon.");
Server(otherID, msg);
format(msg, sizeof(msg), "You have given "CHAT_YELLOW"%s(%d)"CHAT_WHITE" weapon(%d).", GetName(otherID), otherID, weaponid);
Server(playerid, msg);
}