SetupPlayerForClassSelection(playerid)
#1

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
Reply
#2

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'?
Reply
#3

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;

Reply
#4

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.
Reply
#5

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.
Reply
#6

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)