SA-MP Forums Archive
Skin selector when connecting - 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: Skin selector when connecting (/showthread.php?tid=533041)



Skin selector when connecting - brandypol - 22.08.2014

My question is simple. I have a skin selector when someone connects to my server (as many servers do) but the problem is that the skins are invisible. What can I do to make them be visible ??


Re: Skin selector when connecting - BuLLeT[LTU] - 22.08.2014

On OnGameModeInit you need to use AddPlayerClass(info..).

and then
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, same coordinates);
    TogglePlayerControllable(playerid,false);
    SetPlayerFacingAngle(playerid,from addplayerclass);
    SetPlayerCameraPos(playerid, set camera nearby addplayerclass coordinates);
    SetPlayerCameraLookAt(playerid, addplayerclass coordinates);
}



Re: Skin selector when connecting - brandypol - 22.08.2014

Quote:
Originally Posted by BuLLeT[LTU]
Посмотреть сообщение
On OnGameModeInit you need to use AddPlayerClass(info..).

and then
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, same coordinates);
    TogglePlayerControllable(playerid,false);
    SetPlayerFacingAngle(playerid,from addplayerclass);
    SetPlayerCameraPos(playerid, set camera nearby addplayerclass coordinates);
    SetPlayerCameraLookAt(playerid, addplayerclass coordinates);
}
How do I set the camera nearby addplayerclass coordinates in the SetPlayerCameraPos function ?


Re: Skin selector when connecting - BuLLeT[LTU] - 22.08.2014

You just need to use /save command to get coordinates. It's stored in My Documents\GTA San Andreas User Files\SAMP\savedpositions.txt


Re: Skin selector when connecting - brandypol - 22.08.2014

Quote:
Originally Posted by BuLLeT[LTU]
Посмотреть сообщение
You just need to use /save command to get coordinates. It's stored in My Documents\GTA San Andreas User Files\SAMP\savedpositions.txt
Yeah but the problem is that my savedpositions arent in my .txt file because its been a really long time since I scripted my gamemode :/


Re: Skin selector when connecting - BuLLeT[LTU] - 22.08.2014

So use like this:

pawn Код:
SetPlayerCameraPos(playerid,X+5 (coordinate X from addplayerclass + 5 to be it nearby), Y, Z);



Re: Skin selector when connecting - brandypol - 22.08.2014

Quote:
Originally Posted by BuLLeT[LTU]
Посмотреть сообщение
So use like this:

pawn Код:
SetPlayerCameraPos(playerid,X+5 (coordinate X from addplayerclass + 5 to be it nearby), Y, Z);
Thanks a lot dude and if I have 5 skins i guess i repeat all that stuff 5 times ?

SetPlayerPos(playerid, 2495.3455, -1687.9534, 13.5165);
TogglePlayerControllable(playerid,false);
SetPlayerFacingAngle(playerid,269.1425);
SetPlayerCameraPos(playerid,X+5 (2495.3455 + 5), -1687.9534, 13.5165)
SetPlayerCameraLookAt(playerid, 2495.3455, -1687.9534, 13.5165);


Re: Skin selector when connecting - Mzake - 22.08.2014

after u do /save (text to seperat cordinations) goto san andreas user files folder/samp/savedpositions.txt
if this is wht u asking for..


Re: Skin selector when connecting - BuLLeT[LTU] - 23.08.2014

Quote:
Originally Posted by brandypol
Посмотреть сообщение
Thanks a lot dude and if I have 5 skins i guess i repeat all that stuff 5 times ?

SetPlayerPos(playerid, 2495.3455, -1687.9534, 13.5165);
TogglePlayerControllable(playerid,false);
SetPlayerFacingAngle(playerid,269.1425);
SetPlayerCameraPos(playerid,X+5 (2495.3455 + 5), -1687.9534, 13.5165)
SetPlayerCameraLookAt(playerid, 2495.3455, -1687.9534, 13.5165);
You do not repeat everything 5 times because all AddPlayerClass has to be at the same coordinates.


Re: Skin selector when connecting - iFarbod - 23.08.2014

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetCameraBehindPlayer(playerid);
}