Object not being placed on my position x,y,z - 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 not being placed on my position x,y,z (
/showthread.php?tid=540655)
Object not being placed on my position x,y,z -
Josh_Main - 06.10.2014
For some reason, when I use the command, it's not placing the object at all. It's returning the message "You have planted a marijuana bush etc.." but that's all. It's not creating the object I want it to create.
pawn Code:
new string[128], Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
CreateObject(playerid, 823, x, y, z+2, 0, 0, 0);
format(string, sizeof(string), "%s kneels down and plants some weed seeds.", GetICName(playerid));
SendNearByMessage(playerid, ACTION_COLOR, string, 6);
SendClientMessage(playerid, GREEN, "You have planted a marijuana bush, please come back later to harvest it!");
SendClientMessage(playerid, GREEN, "Be careful other players do not take your weed, so keep a close eye on it!");
PlayerStat[playerid][HasWeedSeeds] -= 1;
Any help would be appreciated, thank you
Re: Object not being placed on my position x,y,z -
Sawalha - 06.10.2014
Code:
CreateObject(playerid, 823, x, y, z+2, 0, 0, 0);
?
Code:
CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance)
Shouldn't this return an error?
remove "playerid"
Re: Object not being placed on my position x,y,z -
Josh_Main - 06.10.2014
Quote:
Originally Posted by Sawalha
Code:
CreateObject(playerid, 823, x, y, z+2, 0, 0, 0);
?
Code:
CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance)
Shouldn't this return an error?
remove "playerid"
|
Thanks! I fixed it but the object still isn't being placed
Re: Object not being placed on my position x,y,z -
Matess - 06.10.2014
So if this is your new code
pawn Code:
GetPlayerPos(playerid, x,y,z);
CreateObject( 823, x, y, z+2, 0, 0, 0);
then it should work unless you didn't reached 1000 objects on server without streamer