Need help with error:undefined symbol "SetupPlayerForClassSelection"
#1

I'm still very new to scripting,
I'm making this basic TDM-script from scratch to learn the basics.
also using '' AddplayerClassEx " , " new gTeam[MAX_PLAYERS]; " , " new gPlayerClass[MAX_PLAYERS]; "
I tried looking for tutorials,
but I couldn't find the one with " AddplayerClassEx and new gTeam[MAX_PLAYERS]; used together.

I defined teams and their colors.
pawn Код:
#include <a_samp>

//  TEAMS   //
#define GROVE   0   //  GROVE STREET
#define AZTEC   1   //  AZTECAS
#define TRIAD   2   //  TRIADS
#define BALLA   3   //  BALLAS
#define VAGOS   4   //  VAGOS
#define RIFFA   5   //  RIFFAS
#define ITALI   6   //  ITALIAN MAFIA
#define RUSSI   7   //  RUSSIAN MAFIA

//  TEAM_COLORS //
#define GROVE_COLOR 0x00FF00    //  GREEN
#define AZTEC_COLOR 0x00FFFF    //  CYAN/AQUA
#define TRIAD_COLOR 0x000000    //  BLACK
#define BALLA_COLOR 0x800080    //  PURPLE
#define VAGOS_COLOR 0xFFFF00    //  YELLOW
#define RIFFA_COLOR 0x00CDCD    //  CYAN3
#define ITALI_COLOR 0xDA70D6    //  ORCHID
#define RUSSI_COLOR 0xDC143C    //  CRIMSON

new gTeam[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" SIMPLE_GANG_DEATH_MATCH_TEST");
    print("----------------------------------\n");
}
then added AddPlayerClassEx , spawn points and skins.

pawn Код:
public OnGameModeInit()
{
    SetGameModeText("GANG_DEATH_MATCH_TEST");

//  TEAM_GROVE_STREET   //
    AddPlayerClassEx(0,0,-1956.1792,-858.7108,35.8909,94.7386,0,0,0,0,0,0);     // Carl Johnson     //  classid 0
    AddPlayerClassEx(0,4,-1956.1796,-852.4495,35.8909,91.3153,0,0,0,0,0,0);     // Big Bear Skinny  //  classid 1
    AddPlayerClassEx(0,5,-1956.1742,-865.3016,35.8909,92.5687,0,0,0,0,0,0);     // Big Bear Big     //  classid 2
    AddPlayerClassEx(0,6,-1953.3268,-865.3279,35.8909,271.7737,0,0,0,0,0,0);    // Emmet            //  classid 3
    AddPlayerClassEx(0,65,-1956.1809,-861.8378,35.8909,95.7020,0,0,0,0,0,0);    // Kendl            //  classid 4
    AddPlayerClassEx(0,86,-1953.3270,-862.1342,35.8909,271.7970,0,0,0,0,0,0);   // Ryder            //  classid 5
    AddPlayerClassEx(0,105,-1953.3267,-858.8466,35.8909,271.4836,0,0,0,0,0,0)// Hommie           //  classid 6
    AddPlayerClassEx(0,106,-1953.3269,-855.7074,35.8909,270.5435,0,0,0,0,0,0)// Hommie           //  classid 7
    AddPlayerClassEx(0,107,-1953.3267,-852.0621,35.8909,270.5435,0,0,0,0,0,0)// Hommie           //  classid 8
    AddPlayerClassEx(0,149,-1954.6643,-850.5545,35.8906,5.0261,0,0,0,0,0,0);    // Big Smoke Vest   //  classid 9
    AddPlayerClassEx(0,195,-1956.1812,-856.7148,35.8909,88.2052,0,0,0,0,0,0);   // Denise           //  classid 10
    AddPlayerClassEx(0,269,-1954.7283,-866.8278,35.8906,180.3261,0,0,0,0,0,0)// Big Smoke        //  classid 11
    AddPlayerClassEx(0,270,-1956.1810,-856.7260,35.8909,93.8687,0,0,0,0,0,0);   // Sweet            //  classid 12
    AddPlayerClassEx(0,271,-1956.1812,-860.5609,35.8909,91.0486,0,0,0,0,0,0);   // Ryder            //  classid 13
    AddPlayerClassEx(0,293,-1946.8241,-867.4861,35.8906,327.6175,0,0,0,0,0,0)// OG LOC           //  classid 14

//  TEAM_AZTECAS    //
    AddPlayerClassEx(1,292,-1645.1799,1401.0564,9.8047,135.4714,0,0,0,0,0,0);   // Cesar            //  classid 15
    AddPlayerClassEx(1,116,-1639.5908,1395.1489,9.8047,135.4714,0,0,0,0,0,0);   // Hazer            //  classid 16
    AddPlayerClassEx(1,115,-1651.9246,1407.7083,9.8047,134.5547,0,0,0,0,0,0);   // Gal              //  classid 17
    AddPlayerClassEx(1,114,-1648.0935,1403.6207,9.8047,139.8814,0,0,0,0,0,0);   // Sunny            //  classid 18
    AddPlayerClassEx(1,48,-1658.2126,1412.2886,15.5313,184.0621,0,0,0,0,0,0);   // Hispanic Male    //  classid 19
    AddPlayerClassEx(1,41,-1639.4552,1390.0295,18.4075,54.1476,0,0,0,0,0,0);    // Hispanic Female  //  classid 20

//  TEAM_TRIAD  //
    AddPlayerClassEx(2,294,-2227.5300,630.1570,65.3735,1.3314,0,0,0,0,0,0);     // Wu Zi Mu         //  classid 21
    AddPlayerClassEx(2,208,-2226.3711,625.7622,65.3735,267.2089,0,0,0,0,0,0);   // Su Zi            //  classid 22
    AddPlayerClassEx(2,117,-2212.9705,634.1310,58.0398,354.7980,0,0,0,0,0,0);   // Gangster         //  classid 23
    AddPlayerClassEx(2,118,-2213.3584,625.9802,58.0398,179.3530,0,0,0,0,0,0);   // Gangster         //  classid 24
    AddPlayerClassEx(2,120,-2180.0596,646.3052,54.5263,176.0747,0,0,0,0,0,0);   // Gangster         //  classid 25
    AddPlayerClassEx(2,141,-2232.2092,636.7421,60.1797,86.3390,0,0,0,0,0,0);    // Gangster Girl    //  classid 26
    AddPlayerClassEx(2,263,-2232.2092,636.7421,60.1797,86.3390,0,0,0,0,0,0);    // Gangster Girl    //  classid 27

//  TEAM_BALLA  //
    AddPlayerClassEx(3,13,-2619.5793,115.1928,10.3484,272.8341,0,0,0,0,0,0);    // Balla Girl       //  classid 28
    AddPlayerClassEx(3,102,-2621.9702,118.8493,10.9033,271.9174,0,0,0,0,0,0);   // Balla            //  classid 29
    AddPlayerClassEx(3,103,-2622.0461,123.5954,10.9033,269.4107,0,0,0,0,0,0);   // Balla            //  classid 30
    AddPlayerClassEx(3,104,-2633.9456,129.2132,13.4142,93.9658,0,0,0,0,0,0);    // Balla            //  classid 31

//  TEAM_VAGOS  //
    AddPlayerClassEx(4,108,-2673.8484,779.7158,54.2690,0.6923,0,0,0,0,0,0);     // Vago             //  classid 32
    AddPlayerClassEx(4,109,-2644.5933,780.1951,54.2690,358.4991,0,0,0,0,0,0);   // Vago             //  classid 33
    AddPlayerClassEx(4,110,-2661.5671,780.3441,54.2690,0.3791,0,0,0,0,0,0);     // Vago             //  classid 34
    AddPlayerClassEx(4,215,-2689.0354,779.7709,54.2681,1.3423,0,0,0,0,0,0);     // Vago Woman       //  classid 35

//  TEAM_RIFFAS //
    AddPlayerClassEx(5,273,-2151.3828,-189.5956,41.1297,268.1769,0,0,0,0,0,0)// T-Bone           //  classid 36
    AddPlayerClassEx(5,184,-2151.4192,-196.7208,41.1297,265.9836,0,0,0,0,0,0)// T-Bone Junior    //  classid 37
    AddPlayerClassEx(5,173,-2141.0513,-88.5455,44.9688,2.4911,0,0,0,0,0,0);     // Gangster         //  classid 38
    AddPlayerClassEx(5,174,-2099.5220,-95.9408,41.1297,59.7615,0,0,0,0,0,0);    // Gangster         //  classid 39
    AddPlayerClassEx(5,175,-2140.2354,-111.1659,42.0465,346.7778,0,0,0,0,0,0)// Gangster         //  classid 40
    AddPlayerClassEx(5,55,-2159.0923,-186.3375,41.1297,89.6970,0,0,0,0,0,0);    // Gangster Girl    //  classid 41

//  TEAM_ITALIAN_MAFIA  //
    AddPlayerClassEx(6,119,356.2978,176.0620,1008.3762,270.5753,0,0,0,0,0,0);   // Johny            //  classid 42
    AddPlayerClassEx(6,124,359.1599,174.9290,1008.3893,271.2020,0,0,0,0,0,0);   // Goon             //  classid 43
    AddPlayerClassEx(6,125,359.2124,172.3364,1008.3828,269.0086,0,0,0,0,0,0);   // Goon             //  classid 44
    AddPlayerClassEx(6,126,356.2949,166.8125,1008.3762,272.4787,0,0,0,0,0,0);   // Goon             //  classid 45
    AddPlayerClassEx(6,127,356.2946,178.3335,1008.3762,271.2253,0,0,0,0,0,0);   // Goon             //  classid 46
    AddPlayerClassEx(6,258,356.2979,181.2723,1008.3762,271.5154,0,0,0,0,0,0);   // Goon             //  classid 47
    AddPlayerClassEx(6,259,356.2942,164.2055,1008.3762,269.9487,0,0,0,0,0,0);   // Goon             //  classid 48
    AddPlayerClassEx(6,272,359.7139,173.6577,1008.3893,269.9487,0,0,0,0,0,0);   // Boss             //  classid 49
    AddPlayerClassEx(6,91,357.1790,173.5150,1008.3822,270.1170,0,0,0,0,0,0);    // Wife             //  classid 50


//  TEAM_RUSSIAN_MAFIA  //
    AddPlayerClassEx(7,3,-1540.9369,112.7794,17.3226,134.2635,0,0,0,0,0,0);     // Andre            //  classid 51
    AddPlayerClassEx(7,60,-1568.5757,82.0382,17.3281,48.4094,0,0,0,0,0,0);      // T-Shirt Guy      //  classid 52
    AddPlayerClassEx(7,111,-1562.8346,87.7785,17.3281,52.5062,0,0,0,0,0,0);     // Big Tough Goon   //  classid 53
    AddPlayerClassEx(7,112,-1557.7954,92.8186,17.3281,43.1061,0,0,0,0,0,0);     // Tough Guy        //  classid 54
    AddPlayerClassEx(7,113,-1543.9208,95.9091,17.3281,44.5044,0,0,0,0,0,0);     // Boss Man         //  classid 55
    AddPlayerClassEx(7,216,-1539.9845,95.4003,17.3281,137.2520,0,0,0,0,0,0);    // Boss's Wife      //  classid 56

    return 1;
}
Then I tried to make teams / gangs

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetupPlayerForClassSelection(playerid);
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 7 || classid == 8 || classid == 9 || classid == 10 || classid == 11 || classid == 12 || classid == 13 || classid == 14)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~GROVE_STREET_FAMILIES", 500, 3);
        gTeam[playerid] = 0;
        return 1;
    }
    if(classid == 15 || classid == 16|| classid == 17 || classid == 18 || classid == 19 || classid == 20)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~AZTECAS", 500, 3);
        gTeam[playerid] = 1;
        return 1;
    }
    if(classid == 21 || classid == 22 || classid == 23 || classid == 24 || classid == 25 || classid == 26 || classid == 27)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~THE_TRIADS", 500, 3);
        gTeam[playerid] = 2;
        return 1;
    }
    if(classid == 28 || classid == 29 || classid == 30 || classid == 31)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~BALLAS", 500, 3);
        gTeam[playerid] = 3;
        return 1;
    }
    if(classid == 32 || classid == 33 || classid == 34 || classid == 35)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~VAGOS", 500, 3);
        gTeam[playerid] = 4;
        return 1;
    }
    if(classid == 36 || classid == 37 || classid == 38 || classid == 39 || classid == 40 || classid == 41)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~RIFFAS", 500, 3);
        gTeam[playerid] = 5;
        return 1;
    }
    if(classid == 42 || classid == 43 || classid == 44 || classid == 45 || classid == 46 || classid == 47 || classid == 48 || classid == 49 || classid == 50)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~ITALIAN_MAFIA", 500, 3);
        gTeam[playerid] = 6;
        return 1;
    }
    if(classid == 51 || classid == 52 || classid == 53 || classid == 54 || classid == 55 || classid == 56)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~RUSSIAN_MAFIA", 500, 3);
        gTeam[playerid] = 4;
        return 1;
    }
    return 1;
}
Tried Compiling and gets 9 errors
pawn Код:
C:\Users\User\Desktop\TEST.pwn(122) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(131) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(138) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(145) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(152) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(159) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(166) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(173) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(180) : error 017: undefined symbol "SetupPlayerForClassSelection"
C:\Users\User\Desktop\TEST.pwn(367) : warning 203: symbol is never used: "gPlayerClass"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


9 Errors.
Also is there a way to make this line shorter ?

pawn Код:
if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 7 || classid == 8 || classid == 9 || classid == 10 || classid == 11 || classid == 12 || classid == 13 || classid == 14)
    {
        SetupPlayerForClassSelection(playerid);
        GameTextForPlayer(playerid, "~w~GROVE_STREET_FAMILIES", 500, 3);
        gTeam[playerid] = 0;
        return 1;
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)