SA-MP Forums Archive
Little Help - 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: Little Help (/showthread.php?tid=397747)



Little Help - Sanady - 06.12.2012

Hello.Today I want to make Care Package but Object don`t want to spawn I don`t know why.Here is code

pawn Код:
GetPlayerPos(playerid,CareX,CareY,CareZ);
                    CarePack = CreateObject(3791,CareX,CareY,CareZ+10.0,0.0,0.0,0.0);
                    MoveObject(CarePack,CareX,CareY,CareZ,7.0);
Anyone can take a look.Thanks


Re: Little Help - xMCx - 06.12.2012

CarePack should be under OnFliterScriptInit oR OnGameModeInit cause its an object


Re: Little Help - Sanady - 06.12.2012

Quote:
Originally Posted by xMCx
Посмотреть сообщение
CarePack should be under OnFliterScriptInit oR OnGameModeInit cause its an object
No need to be under OnFilterScriptInit


Re: Little Help - Sanady - 06.12.2012

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
Nope again, objects can be dynamically created and destoryed in runtime, the only thing I can think of that needs to be created on script initiation are static vehicles and pickups (AddStaticVehicle/Pickup)

Ensure that the model ID is valid, also try spacing out your code because at first I thought you might have made the stream distance 0.0:

Код:
CreateObject(3791, CareX, CareY, CareZ+10.0, 0.0, 0.0, 0.0);
Much easier to read parameters than:
Код:
CreateObject(3791,CareX,CareY,CareZ+10.0,0.0,0.0,0.0);
I can now see that your position and rotation are fine and there is no 'streamdistance = 0.0'.

Is the player in another virtual world? Are the coordinates correct? (try printing them, though they should be if the source is GetPlayerPos) Try creating that object model in the various map editors (SA:MP Map Editor mainly) don't trust MTA as some objects that work in there may not work in SA:MP (I've come across this before)

Also, ensure you haven't reached the object limit of 500 (for global objects) you could try using a streamer such as Incognito's Streamer Plugin to avoid this problem.
I try your solution but it`s not working I don`t know why.