gTEAM problem please help!
#1

I am making simple team gamemode !!
Thats the code till now:
Код:
//
#include <a_samp>
#include <zcmd>
#pragma tabsize 0

#define CIVILIAN 1
#define POLICE 2
#define CIVILIAN_COLOUR 0xFFFFFFFF
#define POLICE_COLOUR 0x00F2FFAA

new gTeam[MAX_PLAYERS];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
}

#endif

public OnGameModeInit()
{
	AddPlayerClass(0,1543.5481,-1675.7903,13.5567,88.9385,0,0,0,0,0,0); // Police officer(cop)
	AddPlayerClass(0,1071.0199,-1776.8431,13.3369,2.1094,0,0,0,0,0,0); // CIVILIAN
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerTeamFromClass(playerid, classid)
{
	if(classid == 0)
 	{
        gTeam[playerid] = CIVILIAN;
	}
		if(classid == 1)
 	{
        gTeam[playerid] = POLICE;
	}
}
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

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

public OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == CIVILIAN)
    {
        SetPlayerColor(playerid,CIVILIAN_COLOUR); //Green
    }
        if(gTeam[playerid] == POLICE)
    {
        SetPlayerColor(playerid,POLICE_COLOUR); //Green
    }
}
	return 1;
}
Found these errors:
Код:
C:\Users\----\Desktop\Roleplay\gamemodes\TEAMS.pwn(47) : error 017: undefined symbol "SetPlayerTeamFromClass"
C:\Users\----\Desktop\Roleplay\gamemodes\TEAMS.pwn(73) : error 017: undefined symbol "SetPlayerToTeamColour"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Please help!!
Thanks!
Ironmen
Reply
#2

You do not have these functions inside your gamemode; you have to create them.

for example: SetPlayerToTeamColour
pawn Код:
stock SetPlayerToTeamColour(playerid)
{
     if(gTeam[playerid] == POLICE) SetPlayerColor(playerid, POLICE_COLOUR);
     else if(gTeam[playerid] == CIVILIAN) SetPlayerColor(playerid, CIVILIAN_COLOUR);
}
so under OnPlayerSpawn:

pawn Код:
public OnPlayerSpawn(playerid)
{
     SetPlayerToTeamColour(playerid);
     return 1;
}
I hope I helped any feedback is appreciated - these are examples they might not be what you really want the code to do!
Reply
#3

Quote:
Originally Posted by Stanford
Посмотреть сообщение
You do not have these functions inside your gamemode; you have to create them.

for example: SetPlayerToTeamColour
pawn Код:
stock SetPlayerToTeamColour(playerid)
{
     if(gTeam[playerid] == POLICE) SetPlayerColor(playerid, POLICE_COLOUR);
     else if(gTeam[playerid] == CIVILIAN) SetPlayerColor(playerid, CIVILIAN_COLOUR);
}
so under OnPlayerSpawn:

pawn Код:
public OnPlayerSpawn(playerid)
{
     SetPlayerToTeamColour(playerid);
     return 1;
}
I hope I helped any feedback is appreciated - these are examples they might not be what you really want the code to do!
Thanks !!
it worked!!
Sorry im begginner!!
+rep
Reply
#4

Sorry but can you help me make the stock " SetPlayerTeamFromClass) ??

Reply
#5

Thanks i fixed it!!!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)