SA-MP Forums Archive
[ajuda] playerid classid - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda] playerid classid (/showthread.php?tid=316164)



[ajuda] playerid classid - mau.tito - 05.02.2012

Erros
pawn Код:
error 004: function "OnPlayerRequestClass" is not implemented //1erro
error 017: undefined symbol "playerid"
error 017: undefined symbol "classid"// 1 errro
Ele da Erro Em Tudo isso
pawn Код:
public OnPlayerRequestClass( playerid, classid)//1erro
{
    SetPlayerInterior(playerid,14);
    SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
    SetPlayerFacingAngle(playerid, 270.0);
    SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
    SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
    switch (classid)//1erro
    {
        case 0, 1, 2, 3, 4, 5, 6, 7:
    {
            GameTextForPlayer(playerid, TXT_ClassTrucker, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassTruckDriver;
        }
        case 8, 9:
        {
            GameTextForPlayer(playerid, TXT_ClassBusDriver, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassBusDriver;
        }
        case 10:
        {
            GameTextForPlayer(playerid, TXT_ClassPilot, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassPilot;
        }
        case 11, 12, 13:
        {
            GameTextForPlayer(playerid, TXT_ClassPolice, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassPolice;
        }
        case 14, 15, 16:
        {
            GameTextForPlayer(playerid, TXT_ClassMafia, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassMafia;
        }
        case 17, 18:
        {
            GameTextForPlayer(playerid, TXT_ClassCourier, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassCourier;
        }
        case 19:
        {
            GameTextForPlayer(playerid, TXT_ClassAssistance, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassAssistance;
        }
        case 20, 21, 22:
        {
            GameTextForPlayer(playerid, TXT_ClassRoadWorker, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassRoadWorker;
        }
     }
    return 1;
}



Re: [ajuda] playerid classid - makino - 05.02.2012

public OnPlayerRequestClass(playerid, classid)//1erro
tenta assim tirei o espaзo


Re: [ajuda] playerid classid - mau.tito - 05.02.2012

Quote:
Originally Posted by makino
Посмотреть сообщение
public OnPlayerRequestClass(playerid, classid)//1erro
tenta assim tirei o espaзo
kkkk Continua o Erro e Vi outro Agora
pawn Код:
function "OnGameModeExit" is not implemented



Re: [ajuda] playerid classid - Lucas_Alemao - 05.02.2012

tem certeza de que nгo ta pondo essa callback dentro de outra?


Re: [ajuda] playerid classid - makino - 05.02.2012

man tem certeza qe isso ae que vocк colocou fica em onplayerrequestclass ? axo qe ae nao tem playerid


Re: [ajuda] playerid classid - mau.tito - 05.02.2012

Absoluta olha
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SetPlayerInterior(playerid,14);
    SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
    SetPlayerFacingAngle(playerid, 270.0);
    SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
    SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
    switch (classid)
    {
        case 0, 1, 2, 3, 4, 5, 6, 7:
    {
            GameTextForPlayer(playerid, TXT_ClassTrucker, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassTruckDriver;
        }
        case 8, 9:
        {
            GameTextForPlayer(playerid, TXT_ClassBusDriver, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassBusDriver;
        }
        case 10:
        {
            GameTextForPlayer(playerid, TXT_ClassPilot, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassPilot;
        }
        case 11, 12, 13:
        {
            GameTextForPlayer(playerid, TXT_ClassPolice, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassPolice;
        }
        case 14, 15, 16:
        {
            GameTextForPlayer(playerid, TXT_ClassMafia, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassMafia;
        }
        case 17, 18:
        {
            GameTextForPlayer(playerid, TXT_ClassCourier, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassCourier;
        }
        case 19:
        {
            GameTextForPlayer(playerid, TXT_ClassAssistance, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassAssistance;
        }
        case 20, 21, 22:
        {
            GameTextForPlayer(playerid, TXT_ClassRoadWorker, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassRoadWorker;
        }
     }
    return 1;
}



Re: [ajuda] playerid classid - [A]rray - 05.02.2012

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
Absoluta olha
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SetPlayerInterior(playerid,14);
    SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
    SetPlayerFacingAngle(playerid, 270.0);
    SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
    SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
    switch (classid)
    {
        case 0, 1, 2, 3, 4, 5, 6, 7:
    {
            GameTextForPlayer(playerid, TXT_ClassTrucker, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassTruckDriver;
        }
        case 8, 9:
        {
            GameTextForPlayer(playerid, TXT_ClassBusDriver, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassBusDriver;
        }
        case 10:
        {
            GameTextForPlayer(playerid, TXT_ClassPilot, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassPilot;
        }
        case 11, 12, 13:
        {
            GameTextForPlayer(playerid, TXT_ClassPolice, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassPolice;
        }
        case 14, 15, 16:
        {
            GameTextForPlayer(playerid, TXT_ClassMafia, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassMafia;
        }
        case 17, 18:
        {
            GameTextForPlayer(playerid, TXT_ClassCourier, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassCourier;
        }
        case 19:
        {
            GameTextForPlayer(playerid, TXT_ClassAssistance, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassAssistance;
        }
        case 20, 21, 22:
        {
            GameTextForPlayer(playerid, TXT_ClassRoadWorker, 3000, 4);
            APlayerData[playerid][PlayerClass] = ClassRoadWorker;
        }
     }
    return 1;
}
O seu cуdigo estб mal identado, tente melhorar... pode ser disso.

Errado:
pawn Код:
Funcao1
{
    Funcao2
  {
        Funcao3
        {
            Funcao3Acabada
        }
     }
    return true;
}
Certo:
pawn Код:
Funcao1
{
    Funcao2
    {
        Funcao3
        {
            Funcao3Acabada
        }
    }
    return true;
}
A identaзгo pode provocar erros ou warnings.


Re: [ajuda] playerid classid - Lucas_Alemao - 05.02.2012

LoL tem nada haver isso nгo [A]rray, o que pode acontecer й sу warning '-'


Re: [ajuda] playerid classid - [A]rray - 05.02.2012

(DELETE PLEASE)


Re: [ajuda] playerid classid - [A]rray - 05.02.2012

Pode ter apagado o forward sem querer no include.. coloque no topo do gamemode:
pawn Код:
forward OnPlayerRequestClass(playerid, classid);