Object isnt coming up in filterscript
#1

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?
Reply
#2

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);
Reply
#3

Tried that, still didn't show up.
Reply
#4

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

That worked.

Thanks dude !
Reply
#6

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

Thanks dude !
Have u test it in game?
Reply
#7

Yep, worked!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)