How to remove inventory items ?
#5

Quote:
Originally Posted by iLearner
Посмотреть сообщение
there's already a cmd in dayz 9.1, so called resetinv, if not:

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(stringsizeof(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;

Thank you!
Reply


Messages In This Thread
How to remove inventory items ? - by buhs - 03.12.2016, 19:36
Re: How to remove inventory items ? - by BrianFaria - 03.12.2016, 22:05
Re: How to remove inventory items ? - by buhs - 04.12.2016, 06:24
Re: How to remove inventory items ? - by iLearner - 04.12.2016, 07:28
Re: How to remove inventory items ? - by buhs - 04.12.2016, 08:15

Forum Jump:


Users browsing this thread: 2 Guest(s)