SA-MP Forums Archive
SetupPlayerForClassSelection(playerid) - 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: SetupPlayerForClassSelection(playerid) (/showthread.php?tid=434141)



SetupPlayerForClassSelection(playerid) - Areax - 01.05.2013

Hello!

I have another problem...

Error:

PHP код:
C:\DOCUME~1\Tadej\Desktop\SA-MPS~1\GAMEMO~1\New.pwn(278) : error 017undefined symbol "SetupPlayerForClassSelection"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Error

Code:

PHP код:
    SetupPlayerForClassSelection(playerid)
    {
    
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
    
SetPlayerFacingAngle(playerid270.0);
    
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
    
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);

What's the problem? Thanks


Re: SetupPlayerForClassSelection(playerid) - Lordzy - 01.05.2013

It means that the function 'SetupPlayerForClassSelection' is not defined in the script. What are you trying to do here? Force player to class selection or 'OnPlayerRequestClass'?


Re: SetupPlayerForClassSelection(playerid) - Areax - 01.05.2013

I have this under OnPlayerRequestClass

Like this:

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    switch(
classid)
    {
    case 
0:
    {
    
SetPlayerTeam(playeridTEAM_MAFIA);
    
GameTextForPlayer(playerid"~r~Mafia"10003);
    }
    case 
1:
    {
    
SetPlayerTeam(playeridTEAM_MAFIA);
    
GameTextForPlayer(playerid"~r~Mafia"10003);
    }
    case 
2:
    {
    
SetPlayerTeam(playeridTEAM_MAFIA);
    
GameTextForPlayer(playerid"~r~Mafia"10003);
    }
    case 
3:
    {
    
SetPlayerTeam(playeridTEAM_MAFIA);
    
GameTextForPlayer(playerid"~r~Mafia"10003);
    }
    case 
4:
    {
    
SetPlayerTeam(playeridTEAM_MAFIA);
    
GameTextForPlayer(playerid"~r~Mafia ~g~Medic"10003);
    }
    case 
5:
    {
    
SetPlayerTeam(playeridTEAM_POLICE);
    
GameTextForPlayer(playerid"~b~Police"10003);
    }
    case 
6:
    {
    
SetPlayerTeam(playeridTEAM_POLICE);
    
GameTextForPlayer(playerid"~b~Police"10003);
    }
    case 
7:
    {
    
SetPlayerTeam(playeridTEAM_POLICE);
    
GameTextForPlayer(playerid"~b~Police"10003);
    }
    case 
8:
    {
    
SetPlayerTeam(playeridTEAM_POLICE);
    
GameTextForPlayer(playerid"~b~Police"10003);
    }
    case 
9:
    {
    
SetPlayerTeam(playeridTEAM_POLICE);
    
GameTextForPlayer(playerid"~b~Police ~g~Medic"10003);
    }
    }
    
SetupPlayerForClassSelection(playerid)
    {
    
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
    
SetPlayerFacingAngle(playerid270.0);
    
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
    
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
    return 
1;




Re: SetupPlayerForClassSelection(playerid) - Private200 - 01.05.2013

PHP код:
public OnPlayerRequestClass(playeridclassid

    
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234); 
    
SetPlayerFacingAngle(playerid270.0); 
    
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234); 
    
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234); 

    switch(
classid
    { 
    case 
0
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
1
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
2
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
3
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
    
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
4
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia ~g~Medic"10003); 
    } 
    case 
5
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
6
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
7
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
8
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
9
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police ~g~Medic"10003); 
    } 
    } 
    return 
1

This will work fine too, without using the "ForcePlayerForClassSelection" function.

Best of luck.


Re: SetupPlayerForClassSelection(playerid) - Areax - 01.05.2013

Quote:
Originally Posted by Private200
Посмотреть сообщение
PHP код:
public OnPlayerRequestClass(playeridclassid

    
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234); 
    
SetPlayerFacingAngle(playerid270.0); 
    
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234); 
    
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234); 
    switch(
classid
    { 
    case 
0
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
1
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
2
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
3
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
    
GameTextForPlayer(playerid"~r~Mafia"10003); 
    } 
    case 
4
    { 
          
SetPlayerTeam(playeridTEAM_MAFIA); 
          
GameTextForPlayer(playerid"~r~Mafia ~g~Medic"10003); 
    } 
    case 
5
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
6
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
7
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
8
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police"10003); 
    } 
    case 
9
    { 
          
SetPlayerTeam(playeridTEAM_POLICE); 
          
GameTextForPlayer(playerid"~b~Police ~g~Medic"10003); 
    } 
    } 
    return 
1

This will work fine too, without using the "ForcePlayerForClassSelection" function.

Best of luck.
Thanks, but now when I spawn it's everything blank.


Re: SetupPlayerForClassSelection(playerid) - DobbysGamertag - 01.05.2013

Try this:
pawn Код:
SetupPlayerForClassSelection(playerid)
{
    SetPlayerInterior(playerid,1);
    SetPlayerPos(playerid,-779.5753,506.9202,1371.7422);
    SetPlayerFacingAngle(playerid,90.0);
    SetPlayerCameraPos(playerid,-784.3370,506.9630,1371.7422);
    SetPlayerCameraLookAt(playerid,-784.3370,506.9630,1371.7422);
}
public OnPlayerRequestClass(playerid, classid)
{
    SetupPlayerForClassSelection(playerid);
    return 1;
}
To everything being blank. Make sure you
pawn Код:
SetPlayerInterior(playerid,0);