stock AddDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0, drawdistance = 300.0)
{
new oid;
oid = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, worldid, interiorid, playerid, streamdistance);
Streamer_SetFloatData(STREAMER_TYPE_OBJECT, oid, E_STREAMER_DRAW_DISTANCE, drawdistance);
return oid;
}
Sorry it's not a Dynamic object I'm using. I used CreateObject. Does that make a difference?
![]() |
Yes it makes a difference.
When using CreateObject, it will only create a 1000 objects that will be visible to the players. So that's why some plants probably got "removed". When using CreateDynamicObject, the object limit has been exceeded greatly. So switch to dynamic objects. |
Ahhhh! Thanks alot man! Can I simply change CreateObject to CreateDynamicObject? I imagine it has different settings. That would just be too easy!
![]() |
stock AddDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 300.0, Float:drawdistance = 300.0)
wplant[playerid] = CreateDynamicObject( 776, x, y, z-20 , 0, 0, 96, -1, -1, -1, 50);
wplant[playerid] = CreateDynamicObject( 776, x, y, z , 0, 0, 96, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
[i]Try these, because all you did is -20 z = Up & Down, you probably decreased the z too much, that's why the object won't show because it's underground
pawn Код:
|
forward GrowWeed(playerid); public GrowWeed(playerid) { ClearAnimations(playerid); new Float:x, Float:y, Float:z; GetObjectPos(wplant[playerid], x, y, z); MoveDynamicObject(wplant[playerid], x, y, z+1, 0.5, 0, 0, 0); SetTimerEx("GrowWeed2", 300000, 0, "d", playerid);// } forward GrowWeed2(playerid); public GrowWeed2(playerid) { new Float:x, Float:y, Float:z; GetObjectPos(wplant[playerid], x, y, z); MoveDynamicObject(wplant[playerid], x, y, z+1, 0.5, 0, 0, 0); SendClientMessage(playerid, COLOR_SYSTEM, "Your plant has grown"); Ready[playerid] = 1; isplanting[playerid] = 0; } forward GrowWeed3(playerid); public GrowWeed3(playerid) { new Float:x, Float:y, Float:z; GetObjectPos(wplant[playerid], x, y, z); MoveDynamicObject(wplant[playerid], x, y, z-1, 0.5, 0, 0, 0); SendClientMessage(playerid, COLOR_SYSTEM, "Your plant is dieing"); SetTimerEx("GrowWeed4", 180000, 0, "d", playerid);// } forward GrowWeed4(playerid); public GrowWeed4(playerid) { new Float:x, Float:y, Float:z; GetObjectPos(wplant[playerid], x, y, z); MoveDynamicObject(wplant[playerid], x, y, z-2, 0.5, 0, 0, 0); SendClientMessage(playerid, COLOR_SYSTEM, "Your plant has died!"); }
wplant[playerid] = CreateDynamicObject( 776, x, y, z-20 , 0, 0, 96, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));