Help with Teams.
#1

I need help, i'm getting these errors when using gTeam[MAX_PLAYERS];'s as a variable.

Errors.
Код:
C:\Users\MIKE\Desktop\Working\gamemodes\CWATDM.pwn(27) : error 010: invalid function or declaration
C:\Users\MIKE\Desktop\Working\gamemodes\CWATDM.pwn(81) : error 017: undefined symbol "gTeam"
C:\Users\MIKE\Desktop\Working\gamemodes\CWATDM.pwn(81) : warning 215: expression has no effect
C:\Users\MIKE\Desktop\Working\gamemodes\CWATDM.pwn(81) : error 001: expected token: ";", but found "]"
C:\Users\MIKE\Desktop\Working\gamemodes\CWATDM.pwn(81) : error 029: invalid expression, assumed zero
C:\Users\MIKE\Desktop\Working\gamemodes\CWATDM.pwn(81) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Script.
Код:
//Includes.
#include <a_samp>
#include <ZCMD>

//COLORS
#define COLOR_GREY          0xAD9797FF
#define COLOR_GREEN         0x58AB54FF
#define COLOR_PURPLE        0x963A99FF
#define COLOR_YELLOW        0xEAFF03FF
#define COLOR_LIGHTBLUE     0x7ED5F2FF
#define COLOR_RED           0xFF0D1DFF
#define COLOR_WHITE         0xFFFFFFFF
#define COLOR_BLUE          0x5D00FFFF

//Dialog IDS

//Variables
#define TEAM_ONE            1

main()
{
	print("\n----------------------------------");
	print(" Colonial Watts Avenue TDM 9.7 Loaded Successfully");
	print("----------------------------------\n");
}

gTeam[MAX_PLAYERS];

public OnGameModeInit()
{
	//Main Functions
	SetGameModeText("CWA TDM 9.7");
	
	//3D Text
	Create3DTextLabel("Colonial Watts Avenue XXVII - Spawn", COLOR_WHITE, 1574.2770,-1695.3258,6.2188, 8.0, 0, 0);
	Create3DTextLabel("Colonial Watts Avenue XXVII - HOOD", COLOR_WHITE, 2337.1577,-1696.2888,13.5240, 8.0, 0, 0);
	Create3DTextLabel("Colonial Watts Avenue XXVII - HOOD", COLOR_WHITE, 2337.5432,-1670.0953,13.5328, 8.0, 0, 0);
	Create3DTextLabel("Colonial Watts Avenue XXVII - HOOD", COLOR_WHITE, 2348.7312,-1684.6971,13.5231, 8.0, 0, 0);

	
	//Vehicles
	AddStaticVehicle(426,2337.6921,-1693.1022,13.1497,181.1669,0,0); // Vehicle 1 - CWA
	AddStaticVehicle(445,2337.2708,-1676.3564,13.1585,182.4808,0,0); // Vehicle 2 - CWA
	AddStaticVehicle(567,2356.2888,-1696.0590,13.0939,90.0815,0,0); // Vehicle 3 - CWA
	AddStaticVehicle(509,2352.0193,-1666.9619,13.2673,63.9477,0,0); // Vehicle 4 - CWA
	
	//Mappping
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
    new string[256], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Player: (FFFFFF}%s has just joined the server. [CONNECTED]",pName);
    SendClientMessageToAll(COLOR_RED, string);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new string[256], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Player: (FFFFFF}%s has just left the server. [DISCONNECTED/CRASHED]",pName);
    SendClientMessageToAll(COLOR_RED, string);
	return 1;
}

public OnPlayerSpawn(playerid)
{
	gTeam[playerid] == TEAM_ONE;
	SetPlayerColor(playerid, COLOR_GREEN);
	SetPlayerPos(playerid, 2329.3030,-1681.1027,14.6802);
	GameTextForPlayer(playerid, "~g~Colonial Watts Avenue XXVII", 5000, 5);
	GivePlayerWeapon(playerid, 31, 500);
	GivePlayerWeapon(playerid, 23, 500);
	GivePlayerWeapon(playerid, 28, 500);
	return 1;
}

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

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

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

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

//----------------------| ZCMD Command Proccessor | ---------------------------
CMD:help(playerid, params[])
{
	if(gTeam == TEAM_ONE))
	{
	    SendClientMessage(playerid, COLOR_GREY, "[GENERAL]: /animations, /buy1, /buy, /pm, /kill and more to come!");
	    SendClientMessage(playerid, COLOR_GREEN, "[FACTION]: /enter, /exit, /lockerroom, /vehicles");
	}
	else
	{
		SendClientMessage(playerid, COLOR_GREY, "[GENERAL]: /animations, /buy1, /buy, /pm, /kill and more to come!");
	}
	return 1;
}

CMD:kill(playerid, params[])
{
	SetPlayerHealth(playerid, 0);
	return 1;
}


//----------------------|     END OF COMMANDS     | ---------------------------

// - /STR COMMANDS.

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;
	}
    
    if(!strcmp(cmdtext, "/ooc", true, 3)) // 3 Is the length of the /ooc
    {
        if(!cmdtext[3]) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /ooc [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "(( OOC Chat - %s: %s ))", str, cmdtext[4]);
        SendClientMessageToAll(COLOR_WHITE, str);
    }
    return 0;
}

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

Puts you in the beginning of their FS CODE and compile this to see what the:
pawn Код:
new gTeam[MAX_PLAYERS];
Reply
#3

Instead of gTeam[MAX_PLAYERS]; put new gTeam[MAX_PLAYERS];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)