OnPlayerSpawn - 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: OnPlayerSpawn (
/showthread.php?tid=566517)
OnPlayerSpawn -
AroseKhanNiazi - 06.03.2015
I got an custom location mapped it's loaded OnGameInit(); but when i set my camera pose location the objects won't appear while class selection but as i press spawn the objects are here ? but how to do it.
Re: OnPlayerSpawn -
Threshold - 06.03.2015
Depends. How far is the camera from the objects? Are you using a streamer? Is your player located within range of the objects? Do you have a sufficient streamdistance/drawdistance for your objects?
Re: OnPlayerSpawn -
AroseKhanNiazi - 06.03.2015
ah
thanks for telling btw how can i change drawdistance for all objects ? The camers would be like 5-10 meters away and i edited the draw distance and stream distance in streamer.inc becasue i have lot of objects like 400+ and it would take too long to do it 1 by 1
Re: OnPlayerSpawn -
Threshold - 06.03.2015
Код:
CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDistance)
For CreateObject, the last parameter represents drawdistance.
The same applies for a streamer, with CreateDynamicObject.
Код:
CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 200.0, Float:drawdistance = 0.0);
Re: OnPlayerSpawn -
Ritzy2K - 06.03.2015
is ur class selection skin inside sum interior? + m not sure i THINK that world id is different for class selection...then that of normal gameplay...look m not sure tho.
Re: OnPlayerSpawn -
AroseKhanNiazi - 06.03.2015
i am using deafults for everything and i change the default draw distance to 200 and stream distance to 300 still no use
Re: OnPlayerSpawn -
Threshold - 06.03.2015
So you are using a streamer?
If so, try using this:
pawn Код:
Streamer_Update(playerid);
Normally, a streamer updates when a player moves. Seeing as you're not moving during class selection, you will probably have to update the streamer manually for the objects to show.
Re: OnPlayerSpawn -
AroseKhanNiazi - 06.03.2015
No use i added it OnPlayerRequestClass
Re: OnPlayerSpawn -
Ritzy2K - 06.03.2015
Update_StreamerEx under onplayerrequestclass...elseway m confirmed that virtual world is changed during class selection...use virtual world as -1 its gonna work.
Re: OnPlayerSpawn -
AroseKhanNiazi - 06.03.2015
http://orig09.deviantart.net/a945/f/...ke-d8kmru2.png and same..
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
Streamer_UpdateEx(playerid,x,y,z);
SetPlayerPos(playerid,-1743.8019,994.2507,28.6739);
SetPlayerFacingAngle(playerid,92.5084);
GameTextForPlayer(playerid,"~Y~Gold Finder",3000,3);
SetPlayerCameraPos(playerid, -1747.021362,994.213073,29.353200);
SetPlayerCameraLookAt(playerid, -1747.021362,994.213073,29.353200);