Server Crash after Command
#4

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

Reply


Messages In This Thread
Server Crash after Command - by T1 - 03.02.2018, 10:48
Re: Server Crash after Command - by Fratello - 03.02.2018, 10:58
Re: Server Crash after Command - by PepsiCola23 - 03.02.2018, 11:01
Re: Server Crash after Command - by T1 - 04.02.2018, 13:52

Forum Jump:


Users browsing this thread: 1 Guest(s)