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



[SOLVED]Skin Selection Help - JoshP - 29.05.2013

VERY NEW TO SCRIPTING, SORRY IF THIS IS SOO NOOBY!

Код:
public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
if(classid == 107)
{
    SetPlayerPos(playerid, 2317.0159,-1516.9567,25.3438);
    SetPlayerCameraPos(playerid, 2313.0298,-1516.8867,25.3438);
    SetPlayerFacingAngle(playerid, 174.3740);
    SetPlayerCameraLookAt(playerid, 2317.0159,-1516.9567,25.3438);
}

public OnPlayerConnect(playerid)
{
Skin selection just isnt working, im trying to spawn fam3 in. (id 107)


Re: Skin Selection Help - Abhishek. - 29.05.2013

its not skin its the class id (class selection) make it to
if(classid==0)


Re: Skin Selection Help - JoshP - 29.05.2013

Yeah i had that, then wonderd what would happen if i did it.

ok so this gives me an error now

Код:
public OnPlayerRequestClass(playerid, classid)

if(classid == 0)
{
    SetPlayerPos(playerid,2317.0159,-1516.9567,25.3438);
    SetPlayerCameraPos(playerid,2313.0298,-1516.8867,25.3438);
    SetPlayerFacingAngle(playerid,174.3740);
    SetPlayerCameraLookAt(playerid,2317.0159,-1516.9567,25.3438);

if(classid == 1)
{
    SetPlayerPos(playerid,2317.0159,-1516.9567,25.3438);
    SetPlayerCameraPos(playerid,2313.0298,-1516.8867,25.3438);
    SetPlayerFacingAngle(playerid,174.3740);
    SetPlayerCameraLookAt(playerid,2317.0159,-1516.9567,25.3438);
}

    
}
ERROR: error 010: invalid function or declaration

and yh i no both is the same i'll edit later


Re: Skin Selection Help - Tanush123 - 29.05.2013

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(classid == 0)
{
    SetPlayerPos(playerid,2317.0159,-1516.9567,25.3438);
    SetPlayerCameraPos(playerid,2313.0298,-1516.8867,25.3438);
    SetPlayerFacingAngle(playerid,174.3740);
    SetPlayerCameraLookAt(playerid,2317.0159,-1516.9567,25.3438);

if(classid == 1)
{
    SetPlayerPos(playerid,2317.0159,-1516.9567,25.3438);
    SetPlayerCameraPos(playerid,2313.0298,-1516.8867,25.3438);
    SetPlayerFacingAngle(playerid,174.3740);
    SetPlayerCameraLookAt(playerid,2317.0159,-1516.9567,25.3438);
}

   
}



Re: Skin Selection Help - JoshP - 29.05.2013

@Tanush123 I got these errors


Re: Skin Selection Help - Konewka - 29.05.2013

Remember whenever you open something, you have to close it.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
if(classid == 0)
{
    SetPlayerPos(playerid,2317.0159,-1516.9567,25.3438);
    SetPlayerCameraPos(playerid,2313.0298,-1516.8867,25.3438);
    SetPlayerFacingAngle(playerid,174.3740);
    SetPlayerCameraLookAt(playerid,2317.0159,-1516.9567,25.3438);
}
if(classid == 1)
{
    SetPlayerPos(playerid,2317.0159,-1516.9567,25.3438);
    SetPlayerCameraPos(playerid,2313.0298,-1516.8867,25.3438);
    SetPlayerFacingAngle(playerid,174.3740);
    SetPlayerCameraLookAt(playerid,2317.0159,-1516.9567,25.3438);
}
return 1;
}



Re: Skin Selection Help - JoshP - 29.05.2013

Thanks man. It worked, what did you do?


Re: Skin Selection Help - Konewka - 29.05.2013

I added one more bracket under classid==0, however this callback needs to return a value.


Re: Skin Selection Help - JoshP - 29.05.2013

Thanks, i'll remember that.

Btw, just a quick question, how does the script know I want skin id 107?


Re: Skin Selection Help - Konewka - 29.05.2013

Quote:
Originally Posted by JoshP
Посмотреть сообщение
Thanks, i'll remember that.

Btw, just a quick question, how does the script know I want skin id 107?
It doesn't as long as there is no AddPlayerClass under OnGameModeInit. Get familiar with this function: https://sampwiki.blast.hk/wiki/AddPlayerClass