/plant weed ( Object wont come up )
#1

if(strcmp("/plant", cmd, true) == 0)
{
tmp = strtok(cmdtext, idx);
if (!WEEDS[playerid]) return SendClientMessage(playerid, COLOR_GREY," You don't have any Seeds with you.");
if(Weeder[playerid] > 0 && PlayerInfo[playerid][pDonateRank] != 3) return SendClientMessage(playerid, COLOR_GREY,"You recently planted weed, You must wait till the time reduces.");
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY,"USAGE: /plant [weed]");
else if (strcmp("weed", tmp, true) == 0)
{
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_GREY, " Your not on foot");
if (GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, " You must be outside");
if (PlayerInfo[playerid][pJob] != 4) return SendClientMessage(playerid, COLOR_GREY, " You are not a Drugs Dealer !");
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[playerid] = CreateStreamObject(3409, X, Y, Z-2, 0, 0, 0, 200.0, 0);
Weeder[playerid] = 1200;
WeedInfo[weed][WeedX] = X;
WeedInfo[weed][WeedY] = Y;
WeedInfo[weed][WeedZ] = Z;
WeedInfo[weed][WeedTime] = 1;
WeedInfo[weed][WeedPlanted] = 1;
strmid(WeedInfo[weed][WeedPlanter], playername, 0, strlen(playername), 50);
SendClientMessage(playerid,COLOR_GREEN,"You have planted your seeds, It will grow into a weed plant in 1 Minutes.");
SendClientMessage(playerid,COLOR_GREEN,"Remember to type /pickweed Before someone else takes your weed!");
WEEDS[playerid]--;
return 1;
}
}
}
else SendClientMessage(playerid, COLOR_GREY,"USAGE: /setweed [foot]");
return 1;
}

This is the command. Object of weed should come up but he wont :X can any of u guys see visual problem?
Reply
#2

Maybe it is in ground? CreateStreamObject(3409, X, Y, Z-2, 0, 0, 0, 200.0, 0);
Try making it a lil bit higher than player to see if is created. CreateStreamObject(3409, X, Y, Z+1, 0, 0, 0, 200.0, 0);
Reply
#3

nope its not that man thanks for trying to help though
Reply
#4

The object actually exists and is what you think it is? (verified in a map editor or wiki etc).

Also put your PAWN code in pawn tags, it makes it easier to read and find problems .
Reply
#5

yup the object exist I also have another script with almost the same drug system and I've check there and the object shows up no problem.
Dam I've been sitting all night trying to find the problem.
Which pawn codes could I give that might help you figure it out?
Reply
#6

Do those 2 messages just after you create that streamobject actually show up?

Is there an alternative streamer plugin/include you can use? (I dunno what one you are using at the moment).

The best advice I can give, is make a /command which only makes that object and nothing else, see if it does what it should. This would eradicate the code in your original command being the issue if it still doesn't work.
Reply
#7

I'm using incognito's object steamer thats it.
Can you give me an example of command that would straight make an object?
Reply
#8

You are using 0.3c and not 0.3d SA:MP right?

CreateStreamObject is not listed as a function in incognito's streamer plugin.

Are you using the latest here, https://sampforum.blast.hk/showthread.php?tid=102865 ?
Reply
#9

yup, im using this one.
what should I do then? Is there a way to define it inside his plugin?
Reply
#10

That version of the plugin uses CreateDynamicObject for objects so use that instead, I have no idea how CreateStreamObject even comoiles for you lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)