SA-MP Forums Archive
Object isnt coming up in filterscript - 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: Object isnt coming up in filterscript (/showthread.php?tid=388223)



Object isnt coming up in filterscript - UnknownGamer - 28.10.2012

pawn Код:
if(strcmp("/plantweed", cmd, true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if (!WEEDS[playerid]) return SendClientMessage(playerid, COLOR_GREY," You don't have any weed-seeds to be able to grow your crops!");
        if (!WATER[playerid]) return SendClientMessage(playerid, COLOR_GREY," You don't have any pots-of-water, to plant your seeds with!");

            for(new weed = 0; weed < sizeof(WeedInfo); weed++)
            {
                if(WeedInfo[weed][WeedPlanted] == 0 && WeedInfo[weed][WeedTime] == 0)
                {
                    if (GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GRAD2, "You must be on foot!");
                    if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GRAD2, " You must be outside!");
                    new Float:X,Float:Y,Float:Z;
                    GetPlayerPos(playerid, X, Y, Z);
                    GetPlayerName(playerid, playername, 24);
                    ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
                    weedObject[weed] = CreateObject(3409, X, Y, Z-2, 0, 0, 0);
                    Weeder[playerid] = 1200;
                    WeedInfo[weed][WeedX] = X;
                    WeedInfo[weed][WeedY] = Y;
                    WeedInfo[weed][WeedZ] = Z;
                    WeedInfo[weed][WeedTime] = 60;
                    WeedInfo[weed][WeedPlanted] = 1;
                    strmid(WeedInfo[weed][WeedPlanter], playername, 0, strlen(playername), 50);
                    SendClientMessage(playerid,COLOR_FADE1,"You have planted your seeds, it will take about an hour, for your crops to grow fully mature.");
                    SendClientMessage(playerid,COLOR_FADE1,"Remember to type /pickweed Before someone else takes your weed, come back in about an-hour!");
                    WEEDS[playerid] = WEEDS[playerid] - 1;
                    WATER[playerid] = WATER[playerid] - 1;
                    return 1;
                }
            }
            SendClientMessage(playerid,COLOR_FADE1,"USAGE: /plantweed!");
            return 1;
        }
The createobject isn't loading, anybody know why?


Re: Object isnt coming up in filterscript - N0FeaR - 28.10.2012

Remove this
pawn Код:
weedObject[weed] = CreateObject(3409, X, Y, Z-2, 0, 0, 0);
and replace with this.
pawn Код:
weedObject[weed] = CreateDynamicObject(3409, X, Y, Z-2.2, 0, 0, 0, 0);



Re: Object isnt coming up in filterscript - UnknownGamer - 28.10.2012

Tried that, still didn't show up.


Re: Object isnt coming up in filterscript - N0FeaR - 28.10.2012

pawn Код:
weedObject[weed] = CreateObject(3409, X, Y, Z-2.2, 0, 0, 0, 0);
try this.


Re: Object isnt coming up in filterscript - UnknownGamer - 28.10.2012

That worked.

Thanks dude !


Re: Object isnt coming up in filterscript - N0FeaR - 28.10.2012

Quote:
Originally Posted by UnknownGamer
Посмотреть сообщение
That worked.

Thanks dude !
Have u test it in game?


Re: Object isnt coming up in filterscript - UnknownGamer - 28.10.2012

Yep, worked!