SetPlayerTeamFromClass and SetPlayerToTeamColour 'undefined symbol'
#1

Hello,

I've been following some tutorials in how to make teams and saw that I have to use SetPlayerTeamFromClass and SetPlayerToTeamColour.

Somehow, I'm getting the following error: error 017: undefined symbol "SetPlayerTeamFromClass"

Any solution?

Thanks
Reply
#2

show your SetPlayerTeamFromClass function please
Reply
#3

pawn Код:
/*===========================================================
=============================================================
=======          Oh My DeathMatch!  OMDM            =========
=======          Developer: whosHate aka TehHate    =========
=======          Game Mode: Team DeathMatch         =========
=======          Version:   v0.1                    =========
=============================================================
===========================================================*/


/*===========================================================
===== Enjoy this crap and leave credits if you edit ^^ ======
===========================================================*/


/*===========================================================
                          Changelog
                - v0.1: First version of OMDM
===========================================================*/


#include <a_samp>
//======= Color Defines ===========
#define COLOR_WHITE     0xFFFFFFAA
#define COLOR_RED       0xFF0000AA
#define COLOR_GREEN     0x00FF00AA
#define COLOR_BLUE      0x0000FFAA
#define COLOR_GRAY      0xAFAFAFAA
#define COLOR_YELLOW    0xFFFF00AA
#define COLOR_LIGHTBLUE 0x0AFFFFAA
#define COLOR_PURPLE    0xFF00FFAA
#define COLOR_ORANGE    0xFFBB00AA
//=================================

//====== Team Defines =============
#define TEAM_GROVE      0
#define TEAM_LSPD       1
#define TEAM_BALLAS     2
#define TEAM_FBI        3
//=================================

//============ ENUMS ==============
enum TeamCars
{
t11
t12
t13
t14
t21
t22
t23
t24
}
//==================================

//========== Variables =============
new gTeam[MAX_PLAYERS];
new Cars[TeamCars];
//==================================


main()
{
    print("||========Oh My Deathmatch!=======||");
    print("||OMDM Team Deathmatch by whosHate||");
    print("||=============v0.1===============||");
}


public OnGameModeInit()
{
    SetGameModeText("OMDM v0.1");
    //============================= PLAYER CLASSES =========================================
    AddPlayerClass(106,-183.5194,1090.8673,19.7422,52.6484,22,120,28,120,30,120); // Grove
    AddPlayerClass(102,1607.0870,1815.6981,10.8203,193.8336,22,120,28,120,30,120); // Ballas
    //======================================================================================
    //=============================== VEHICLES ==================================
    Cars[t11] = CreateVehicle(463,-168.0218,1079.2097,19.2757,359.2158,0,0,120);
    //===========================================================================
    return 1;
}


public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    {
        if(classid == 0)
        {
        gTeam[playerid] = TEAM_GROVE;
        return 1;
    }
        else if(classid == 1)
        {
        gTeam[playerid] = TEAM_BALLAS;
        return 1;
        }
    }
    SetPlayerToTeamColor(playerid)
    {
        if (gTeam[playerid] == TEAM_GROVE)
        {
            SetPlayerColor(playerid, COLOR_GREEN);
        }
        else if (gTeam[playerid] == TEAM_BALLAS)
        {
            SetPlayerColor(playerid, COLOR_PURPLE);
        }
    }
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 1090.8673, 19.7422, 52.6484);
        return 1;
    }
    else if(gTeam[playerid] == TEAM_BALLAS)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerPos(playerid, 1815.6981, 10.8203, 193.8336);
    return 1;
    }
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/help", cmdtext, true, 4) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
I'm also getting more errors :/

Код:
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(43) : error 001: expected token: "}", but found "-identifier-"
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(56) : error 021: symbol already defined: "Cars"
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(89) : error 017: undefined symbol "SetPlayerTeamFromClass"
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(102) : error 017: undefined symbol "SetPlayerToTeamColor"
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(141) : warning 217: loose indentation
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(143) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Thank you
Reply
#4

this:
Код:
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(89) : error 017: undefined symbol "SetPlayerTeamFromClass"
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(102) : error 017: undefined symbol "SetPlayerToTeamColor"
means, you don't have these functions in your mode... search in the place you found this code, it should be in there.. these are NOT standard samp functions

you forgot a bracket somewhere at:
Код:
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(43) : error 001: expected token: "}", but found "-identifier-"
and at
Код:
C:\Users\Gorka\Desktop\SAMPscripting\gamemodes\MyFirstGM.pwn(56) : error 021: symbol already defined: "Cars"
under new gTeam[MAX_PLAYERS];

delete the new Cars[TeamCars];

after that, only the loose indentation warnings should remain, if you didn't make more errors..

if it's not working, don't give up! experience comes with making faults and keeping trying..
good luck!
Reply
#5

+Repped, thank you, I'll try to do my best ^^
Reply
#6

good luck and thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)