PHP код:
CMD:resetinv(playerid,params[])
{
if(pInfo[playerid][pAdminLevel] >= 5)
{
new targetid,string[128];
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid,-1,""chat" /resetinv [playerid]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
if(!IsPlayerNPC(targetid))
{
format(string, sizeof(string), "*"COL_RED" %s %s has reset %s"COL_WHITE" 's Inventory",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid));
// print("string passed");
SendMessageToAllAdmins(string,-1);
// print("message passed");
ResetPlayerWeapons(targetid);
// print("resetwepaons passed");
ResetPlayerInventory(targetid);
// print("reset inv passed");
AddSlotToInventoryWorld(targetid,"Bandage",1);
// print("bandage passed");
pInfo[targetid][BackpackSlotsUsed] = 1;
// print("info passed");
SendClientMessage(targetid,-1,"*"COL_RED" Your inventory has been reset!");
// print("message passed");
}
else return SendClientMessage(playerid,-1,"*"COL_RED" You cannot do this to an NPC, this has been logged and sent to the server emergency log list!");
}
else {
SendClientMessage(playerid,-1,"*"COL_RED" You do not have the right admin permissions for this command!");
}
return 1;
}