[Tutorial] Team Cars and Team Players
#27

I get this error, followed the tutorial exactly (atleast i think so) :P

C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 017: undefined symbol "Cars"
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 017: undefined symbol "Soa"
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : error 029: invalid expression, assumed zero
C:\Users\fysical\Desktop\samp03bsvr_R2_win32\gamem odes\JimmysDeathMatch.pwn(55) : fatal error 107: too many error messages on one line

Here's my code

Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#if defined FILTERSCRIPT
#include <streamer>
#include <sscanf2>

#define COLOR_RED 0xFF0000AA
#define SOA 1
#define LSPD 2
#define SOA_COLOUR 0x00820FAA
#define LSPD_COLOUR 0x003DF5AA

//kod som gцr sе att bara polis kan gе in i polisbil o soa bara kan gе i soa bike.
enum TeamCars
{
Soa,
Lspd
}

new Cars[TeamCars];
new gTeam[MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Jimmy Karlsson");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" JimmysDeathmatch");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	//Hдr lдgger man till nya skins.
	// Don't use these lines if it's a filterscript
    //SOA BIKES
    Cars[Soa] = CreateVehicle(463,694.8014,-474.0371,15.8537,90.5883,25,1); //Bikes
    Cars[Soa] = CreateVehicle(463,694.6365,-472.5578,15.8562,91.6353,32,1); //Bikes
    Cars[Soa] = CreateVehicle(463,694.5961,-470.9783,15.8557,88.3544,122,1); //Bikes
    Cars[Soa] = CreateVehicle(586,694.7456,-469.3488,15.8561,90.8062,10,1); //Bikes
    Cars[Soa] = CreateVehicle(586,694.7992,-467.5677,15.8553,87.6643,25,1); //Bikes
    //LSPD CAR
    Cars[Lspd] = CreateVehicle(597,1557.6084,-1607.4335,13.1503,3.6478,0,1); //LSPD Cruiser
    return 1;
	SetGameModeText("JimmysDeathmatch");
	//SOA
	AddPlayerClass(247, 1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0);
 	AddPlayerClass(248,1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0);
	//LSPD
	AddPlayerClass(280, 1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0);
	AddPlayerClass(281,1545.7916,-1675.6432,13.5611,92.1874,0,0,0,0,0,0);

	
	return 1;
}

public OnGameModeExit()
{
	return 1;
}
//Hдr har jag gjt sе att positionen дr vid polisstation
//Camerapositionen tittar pе skinnens
//Cameralookat tittar pе skinnens
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid); //gцr sе classen дndras till ett team!
    GivePlayerMoney(playerid, 15000); //han fеr 15000kr nдr han spawnar
	SetPlayerPos(playerid, 1483.5361,-1713.5564,14.0469);
	SetPlayerFacingAngle(playerid, 181.8816);
	SetPlayerCameraPos(playerid, 1483.4851,-1704.9474,14.0469);
	SetPlayerCameraLookAt(playerid, 1483.5361,-1713.5564,14.0469);
	return 1;
}
//Allt detta sker nдr nеgon connectar
public OnPlayerConnect(playerid)
{
	new string[256];
	new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));//denna koden sдger till scriptet att ta personen som connectars player name =)
	format(string, sizeof(string), "Welcome to the server %s fore tutorials and stuff visit http://random.com",playername);
	SendClientMessage(playerid,0xAA3333AA,string); //Stringen gцr sе det i stringen цver
	return 1;
}

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

public OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColor(playerid); //Nдr dom vдljer skin sе ska rдtt nametag o color vдljas det lцser den hдr.
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendClientMessage(killerid,0xAA3333AA,"You murdered a man, and also stole his wallet with 500$ in it, hope no one saw you!");//Om du mцrdar nеgon fеr du detta meddelandet
	GivePlayerMoney(killerid, 500); //om man mцrdar nеgon fеr man 500$ (du rеnar han RP int ekommit sе lеngt дn ;) )
 	SendClientMessage(playerid,0xAA3333AA,"You were murdered and robbed for 500$, watch out next time!"); //om du blir mцrdad fеr du detta meddelandet
	GivePlayerMoney(playerid, -500);//om man dцr fцrlorar man 600
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

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

public OnPlayerText(playerid, text[])
{
	return 1;
}
//Hдr gцr jag kommands man kan anvдnda i spelet
public OnPlayerCommandText(playerid, cmdtext[])
{

	if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid, 0);
		return 1;
	}
	if (strcmp("/buymp5", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid, 29,200);
		GivePlayerMoney(playerid, -15000); //om du skriver /buymp5 sе "kцper" du en mp5 med 200 skott fцr 15000
		return 1;
	}
	if (strcmp("/teleportspawn", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 1545.3984,-1675.6747,13.5603); //X, Y, Z
		return 1;
	}
	if (strcmp("/helpme", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid,0xAA3333AA,"For all the commands/jobs/location etc go to http://random.com");
		return 1;
	}
	if (strcmp("/teleport1", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, 2442.7378,-1279.5771,24.0000); //X, Y, Z
		return 1;
	}
	//denna koden under gцr sе att jag kan spawna en bil, lite mera kompliserat
	if(strcmp("/admincar", cmdtext, true, 5) == 0){
  		new Float:x, Float:y, Float:z, Float:az;
  		GetPlayerPos(playerid, x, y, z);
  		GetPlayerFacingAngle(playerid, az);
  		CreateVehicle(429, x+5, y+5, z, az, -1, -1, 180);
  		return 1;
}
	return 0;
}

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

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

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[Soa] )
        {
            if(gTeam[playerid] != 1)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
        if(CarCheck == Cars[Lspd] )
        {
            if(gTeam[playerid] != 2)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You Don't have the keys for this car!");
                return 1;
            }
        }
        return 1;
    }
    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;
}

SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0)
    {
        gTeam[playerid] = SOA;
    }
    if(classid == 1)
    {
        gTeam[playerid] = LSPD;
    }
}

SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == SOA)
    {
        SetPlayerColor(playerid,SOA_COLOUR); //Green
    }
    if(gTeam[playerid] == LSPD)
    {
        SetPlayerColor(playerid,LSPD_COLOUR); // Blue
    }
}
Reply


Messages In This Thread
Team Cars and Team Players - by Emanuel_Rodriguez - 17.07.2010, 20:30
Re: Team Cars and Team Players - by Thebest96 - 17.07.2010, 21:02
Re: Team Cars and Team Players - by [XST]O_x - 17.07.2010, 21:05
Re: Team Cars and Team Players - by Thebest96 - 17.07.2010, 21:08
Re: Team Cars and Team Players - by Desertsoulz - 20.07.2010, 23:35
Re: Team Cars and Team Players - by Scenario - 20.07.2010, 23:46
Re: Team Cars and Team Players - by 3ventic - 26.07.2010, 15:22
Re: Team Cars and Team Players - by R@ger - 26.07.2010, 15:34
Re: Team Cars and Team Players - by Steven82 - 29.07.2010, 19:30
Re: Team Cars and Team Players - by Scenario - 30.07.2010, 03:40
Re: Team Cars and Team Players - by CEZALAND - 31.07.2010, 22:17
Re: Team Cars and Team Players - by sDAAw - 03.08.2010, 22:27
Re: Team Cars and Team Players - by MadalinX5 - 08.08.2010, 10:08
Re: Team Cars and Team Players - by nexco - 21.08.2010, 20:29
Re: Team Cars and Team Players - by bertuspiteri - 22.08.2010, 20:18
Re: Team Cars and Team Players - by Nekrus2 - 22.08.2010, 23:20
Re: Team Cars and Team Players - by sekol - 30.08.2010, 13:17
Re: Team Cars and Team Players - by Yamoo - 30.08.2010, 17:11
Re: Team Cars and Team Players - by Thebest96 - 01.09.2010, 14:47
Re: Team Cars and Team Players - by Thebest96 - 03.09.2010, 06:25
Re: Team Cars and Team Players - by Nekrus2 - 03.09.2010, 16:40
Re: Team Cars and Team Players - by Nekrus2 - 03.09.2010, 16:42
Re: Team Cars and Team Players - by Thebest96 - 03.09.2010, 21:19
Re: Team Cars and Team Players - by tanush - 16.10.2010, 19:11
Re: Team Cars and Team Players - by IndoScripter - 29.10.2010, 12:03
Re: Team Cars and Team Players - by Tessar - 30.10.2010, 19:45
Re: Team Cars and Team Players - by fysssical - 17.11.2010, 15:33
Re: Team Cars and Team Players - by Miado_Hulk - 20.11.2010, 16:36
Re: Team Cars and Team Players - by ollis93 - 21.11.2010, 17:57
Re: Team Cars and Team Players - by EstSampBro - 20.06.2013, 20:12
Re: Team Cars and Team Players - by hitman14 - 12.08.2014, 12:10
Re: Team Cars and Team Players - by killerbigpoint - 10.10.2014, 16:55
Re: Team Cars and Team Players - by TheRaGeLord - 04.01.2015, 12:59
Re: Team Cars and Team Players - by Ankon - 12.10.2015, 03:58

Forum Jump:


Users browsing this thread: 2 Guest(s)