Server Crash after Command
#3

use this debug codes, after that, please send a server_log.
PHP код:
CMD:newitem(playeridparams[])
{
    
printf("[debug] (newitem) - 1");
    if (!
IsPlayerAdmin(playerid))
    {
        return 
SendClientMessage(playeridCOLOR_TOMATO"You must be RCON-Admin to use this command."),printf("[debug] (newitem) - 1.2");
    }
    
printf("[debug] (newitem) - 2");
    new 
itemName[MAX_ITEM_NAME], itemModelid;
    if (
sscanf(params"is[64]"itemModeliditemName))
    {
        return 
SendClientMessage(playeridCOLOR_DEFAULT"Usage: /newitem [modelid] [name]"),printf("[debug] (newitem) - 2.2");
    }
    
printf("[debug] (newitem) - 3");
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    new 
Float:ang;
    
GetPlayerFacingAngle(playeridang);
    
+= (1.5 floatsin(-angdegrees));
    
+= (1.5 floatcos(-angdegrees));
    
printf("[debug] (newitem) - 4");
    new 
itemid Inv_AddItem(itemModeliditemNamexyz);
    
printf("[debug] (newitem) - 5");
    if (
itemid == -1)
    {
        return 
SendClientMessage(playeridCOLOR_TOMATO"Cannot add anymore items, reached limit."),printf("[debug] (newitem) - 5.2");
    }
    
printf("[debug] (newitem) - 6");
    
Inv_EditItem(playeriditemid);
    
printf("[debug] (newitem) - 7");
    new 
string[128];
    
format(stringsizeof string"Item created: %s [itemid: %i | modelid: %i]"itemNameitemiditemModelid);
    
SendClientMessage(playeridCOLOR_GREENstring);
    
printf("[debug] (newitem) - 8");
    
createdItems[createdItemsCount++] = itemid;
    
SendClientMessage(playeridCOLOR_DEFAULT"Item added to /items list, If you want to duplicate this item, type /additem.");
    
printf("[debug] (newitem) - 9");
    return 
1;

Reply


Messages In This Thread
Server Crash after Command - by T1 - 04.02.2018, 13:31
Re: Server Crash after Command - by JasonRiggs - 04.02.2018, 19:41
Re: Server Crash after Command - by Mugala - 04.02.2018, 22:02
Re: Server Crash after Command - by Sew_Sumi - 04.02.2018, 22:40
Re: Server Crash after Command - by Mugala - 04.02.2018, 22:44
Re: Server Crash after Command - by Sew_Sumi - 04.02.2018, 22:45
Re: Server Crash after Command - by Mugala - 04.02.2018, 22:47
Re: Server Crash after Command - by T1 - 05.02.2018, 19:56
Re: Server Crash after Command - by Sew_Sumi - 05.02.2018, 21:06

Forum Jump:


Users browsing this thread: 2 Guest(s)