SA-MP Forums Archive
Unkown Command issue. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unkown Command issue. (/showthread.php?tid=494141)



Unkown Command issue. - Shockey HD - 11.02.2014

Creating a giftbox system and I have seemed to run into a issue.



The following command is runing into the Unkown Command

pawn Код:
CMD:creategiftbox(playerid, params[])
{
    if(pInfo[playerid][pAdmin] == 5)
    {
        if(GiftBoxSpawned < MAX_GIFTBOXS)
        {
            GiftBoxSpawned++;
            GetPlayerPos(playerid, GiftData[GiftBoxSpawned][gXPos],GiftData[GiftBoxSpawned][gYPos], GiftData[GiftBoxSpawned][gZPos]);
            GiftData[GiftBoxSpawned][Model] = CreateObject(19054,GiftData[GiftBoxSpawned][gXPos],GiftData[GiftBoxSpawned][gYPos], GiftData[GiftBoxSpawned][gZPos], 0,0,0,250);
            GiftData[GiftBoxSpawned][ggLabel] = Create3DTextLabel("Gift box!\nType /getgift to claim your gift!", COLOR_YELLOW, GiftData[GiftBoxSpawned][gXPos],GiftData[GiftBoxSpawned][gYPos], GiftData[GiftBoxSpawned][gZPos]+1.3, 15.0, 0, 0);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Maxed Spawned");
        }
    }
    else
    {
        Bad_Rank(playerid, COLOR_GREY);
    }
    return 1;
}
Although once I have reached max giftboxes it will then show Maxed Spawned.


What am I doing wrong?


Solved, Had to put GiftBoxSpawned++; at the bottlom.