NRG Race help
#1

Hello I found some script from some race and i did my race on that script becouse is very good


but i have problem

2. and didn't now how to fix it bbut i put the CP in it

this is script with CP

Код:
C:\Documents and Settings\doma\Desktop\kucni server\filterscripts\nrgrace2.pwn(46) : error 029: invalid expression, assumed zero
C:\Documents and Settings\doma\Desktop\kucni server\filterscripts\nrgrace2.pwn(46) : warning 215: expression has no effect
C:\Documents and Settings\doma\Desktop\kucni server\filterscripts\nrgrace2.pwn(46) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\doma\Desktop\kucni server\filterscripts\nrgrace2.pwn(46) : error 017: undefined symbol "CP"
C:\Documents and Settings\doma\Desktop\kucni server\filterscripts\nrgrace2.pwn(46) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
#include <a_samp>

#define FILTERSCRIPT
#define COLOR_DARKBLUE 0x0000D0FF
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_LIGHTBLUE 0xBBFFFFFF
#define COLOR_BLACK 0x000000FF
#if defined FILTERSCRIPT
new gate1;
new gate2;
new sendername[MAX_PLAYER_NAME];
main()
{

}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE, "Ovaj server koristi NRG race napravljen by: Galeb.");
return 1;
}
public OnFilterScriptInit()

{
print("|______________NRG race[FS]______________|");
print("|___________Created By: galeb____________|");
print("|______________© 2009__________________|");

CreateObject(972, -1972.061279, 890.428467, 44.200005, 0.0000, 0.0000, 0.0000);
CreateObject(972, -1972.135864, 873.428467, 44.200005, 0.0000, 0.0000, 0.0000);
CreateObject(972, -1981.157593, 907.769836, 44.200005, 0.0000, 0.0000, 270.6186);
CreateObject(972, -1976.822388, 860.274963, 44.794777, 0.0000, 0.0000, 90.2409);
CreateObject(993, -1991.241699, 867.704468, 47.186672, 0.0000, 0.0000, 90.2409);
CreateObject(993, -1991.290527, 874.914551, 47.173553, 0.0000, 0.0000, 90.2409);
CreateObject(993, -1991.369629, 899.373230, 47.261719, 0.0000, 0.0000, 90.2409);
CreateObject(993, -1991.328979, 893.421692, 47.286720, 0.0000, 0.0000, 89.3814);
gate1 = CreateObject(969, -1991.581177, 884.492920, 47.201939, 0.0000, 0.0000, 90.0000);
gate2 = CreateObject(969, -1983.659912, 845.697510, 44.980431, 0.0000, 0.0000, 90.0000);

return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
//------------------------------Checkpoint ------------------------------------------
	new name[MAX_PLAYER_NAME];
	new string[128];
	else if(CP[playerid] == 300) { CP[playerid] = 301; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1990.8082,845.3881,45.6682,50.0); } //1
	else if(CP[playerid] == 301) { CP[playerid] = 302; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1990.1111,845.4772,45.2969,50.0); } //2
	else if(CP[playerid] == 302) { CP[playerid] = 303; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1854.2563,846.4569,35.0569,50.0); } //3
	else if(CP[playerid] == 303) { CP[playerid] = 304; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1673.5345,846.2385,24.6948,50.0); } //4
	else if(CP[playerid] == 304) { CP[playerid] = 305; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1560.8887,844.1173,7.0391,50.0); } //5
	else if(CP[playerid] == 305) { CP[playerid] = 306; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1526.5807,884.1758,7.0391,50.0); } //6
	else if(CP[playerid] == 306) { CP[playerid] = 307; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1617.6240,925.2701,7.6576,50.0); } //7
	else if(CP[playerid] == 307) { CP[playerid] = 308; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1808.1826,926.7799,24.7422,50.0); } //8
	else if(CP[playerid] == 308) { CP[playerid] = 309; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1981.3612,926.8416,45.6645,50.0); } //9
	else if(CP[playerid] == 309) { CP[playerid] = 310; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1979.0359,921.5753,45.2969,50.0); } //10
	else if(CP[playerid] == 310) { CP[playerid] = 311; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -2001.6895,886.9785,45.2969,50.0); } //Finish
	else if(CP[playerid] == 311)
	{
	CP[playerid] = 0;
	DisablePlayerCheckpoint(playerid);
	GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "NRG race : %s je upravo zavrsio NRG Race. ", name);
	SendClientMessageToAll(0xFFFFFFAA, string);
	}
	//-------------------------KRAJ--------------
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}
public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print(" NRG race LOADED");
}

#endif


public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx = 0;
	new cmd[128];
	cmd = strtok(cmdtext, idx);
	new tmp[128];
	new giveplayerid;
	new giveplayer[MAX_PLAYER_NAME];
	new sendername[MAX_PLAYER_NAME];
	new string[128];
	if (strcmp("/nrghelp", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_BLACK, "__________________________________________________");
		SendClientMessage(playerid, COLOR_DARKBLUE, "|~|~|Commands|~|~|");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrghelp - Ova komanda stvara ovo ;D.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/clearchat - Ova komanda ocisti chat.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgs - Igraci startaju race.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgp - Dize se ogradiza za start.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/setnrgracer - Poziva igraca na startnu liniju.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgo - Otvara garazu sa NRG-ovima.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgz - Zatvara vrata sa NRG-ovima.");
		SendClientMessage(playerid, COLOR_BLACK, "__________________________________________________");
    return 1;
	}
	if(strcmp(cmdtext,"/clearchat",true)==0)
	{
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		return 1;
	}
  if(strcmp(cmdtext,"/setnrgracer",true)==0)
	{
		SetPlayerCheckpoint(playerid,-1990.8082,845.3881,45.6682,50.0);
		GameTextForPlayer(playerid, "Vas NRG ORGANIZATOR %s je pozvao %s na NRG start liniju!", sendername, giveplayer);
		return 1;
	}

	if(strcmp(cmdtext,"/nrgs",true)==0)
	{
    MoveObject(gate2,-1983.659912, 845.697510, 44.980431,50.000);
		return 1;
	}
	if(strcmp(cmdtext,"/nrgp",true)==0)
	{
    MoveObject(gate2,-1983.595093, 845.671875, 42.480431,50.000);
		return 1;
	}
		if(strcmp(cmdtext,"/nrgo",true)==0)
	{
    MoveObject(gate1,-1991.581177, 884.492920, 47.201939,5);
		return 1;
	}
	if(strcmp(cmdtext,"/nrgz",true)==0)
	{
    MoveObject(gate1,-1991.512939, 884.430969, 40.476517,5);
		return 1;
	}
	return 0;
}




please help
Reply
#2

give us the line '46'
Reply
#3

Код:
else if(CP[playerid] == 300)
to
Код:
if(CP[playerid] == 300)
and on top
Код:
new CP[200];
Reply
#4

tnx i did it soon i will pt it on forum D;
Reply
#5

hello


i having problem finishing race :S


i put my script like this:

Код:
//---------------------------------NRG----------------------------------------------
	else if(CP[playerid] == 300) { CP[playerid] = 301; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1854.2563,846.4569,35.0569, 10.0); }
	else if(CP[playerid] == 301) { CP[playerid] = 302; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1673.5345,846.2385,24.6948, 10.0); }
	else if(CP[playerid] == 302) { CP[playerid] = 303; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1560.8887,844.1173,7.0391, 10.0); }
	else if(CP[playerid] == 303) { CP[playerid] = 304; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1526.5807,884.1758,7.0391, 10.0); }
	else if(CP[playerid] == 304) { CP[playerid] = 305; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1617.6240,925.2701,7.6576, 10.0); }
	else if(CP[playerid] == 305) { CP[playerid] = 306; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1808.1826,926.7799,24.7422, 10.0); }
	else if(CP[playerid] == 306) { CP[playerid] = 307; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1981.3612,926.8416,45.6645, 10.0); }
	else if(CP[playerid] == 307) { CP[playerid] = 308; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1979.0359,921.5753,45.2969, 10.0); }
	else if(CP[playerid] == 309) { CP[playerid] = 309; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -2001.6895,886.9785,45.2969, 10.0); }
	else if(CP[playerid] == 310)
	{
	  CP[playerid] = 0;
	  DisablePlayerCheckpoint(playerid);
	  GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "Organizator : %s je upravo zavrsio Utrku. ", name);
		SendClientMessageToAll(COLOR_LIGHTRED, string);
	  }
and it's all great, but when i come to last CP then one CP hoo is not on my CP list apears up and i can't do anything with it


So i need help how to winish my race
Reply
#6

refresh Please peoples i don't now how to fix this


Reply
#7

give me the lines not the all script ok?
Reply
#8

ok here you go my race



Код:
new gate1;
new gate2;
Код:
public OnPlayerEnterCheckpoint(playerid)
{
Код:
//---------------------------------NRG----------------------------------------------
	else if(CP[playerid] == 300) { CP[playerid] = 301; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1854.2563,846.4569,35.0569, 10.0); }
	else if(CP[playerid] == 301) { CP[playerid] = 302; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1673.5345,846.2385,24.6948, 10.0); }
	else if(CP[playerid] == 302) { CP[playerid] = 303; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1560.8887,844.1173,7.0391, 10.0); }
	else if(CP[playerid] == 303) { CP[playerid] = 304; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1526.5807,884.1758,7.0391, 10.0); }
	else if(CP[playerid] == 304) { CP[playerid] = 305; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1617.6240,925.2701,7.6576, 10.0); }
	else if(CP[playerid] == 305) { CP[playerid] = 306; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1808.1826,926.7799,24.7422, 10.0); }
	else if(CP[playerid] == 306) { CP[playerid] = 307; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1981.3612,926.8416,45.6645, 10.0); }
	else if(CP[playerid] == 307) { CP[playerid] = 308; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -1979.0359,921.5753,45.2969, 10.0); }
	else if(CP[playerid] == 309) { CP[playerid] = 309; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -2001.6895,886.9785,45.2969, 10.0); }
	else if(CP[playerid] == 310)
	{
	  CP[playerid] = 0;
	  DisablePlayerCheckpoint(playerid);
	  GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "Organizator : %s je upravo zavrsio Utrku. ", name);
		SendClientMessageToAll(COLOR_LIGHTRED, string);
	  }


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
Код:
// --------------------------------NRG---------------------------------
	if (strcmp("/nrghelp", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "__________________________________________________");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "|~|~|Commands|~|~|");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrghelp - Ova komanda stvara ovo ;D.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/clearchat - Ova komanda ocisti chat.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgs - Igraci startaju race.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgp - Dize se ogradiza za start.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrg - Poziva igraca na startnu liniju.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgo - Otvara garazu sa NRG-ovima.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "/nrgz - Zatvara vrata sa NRG-ovima.");
		SendClientMessage(playerid, COLOR_LIGHTBLUE, "__________________________________________________");
    return 1;
	}
	if(strcmp(cmdtext,"/clearchat",true)==0)
	{
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		SendClientMessage(playerid,COLOR_WHITE," ");
		return 1;
	}
  if (strcmp(cmd, "/setnrg", true)==0)
	{
		if(PlayerInfo[playerid][pAdmin] >= 2)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "KORISTITE: /setnrg [playerid/PartOfName]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 2)
			{
				if(IsPlayerConnected(giveplayerid))
				{
					SetPlayerCheckpoint(giveplayerid, -1990.8082,845.3881,45.6682,50.0);
					CP[giveplayerid] = 300;
					GetPlayerName(playerid, sendername, sizeof(sendername));
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					format(string, sizeof(string), " ORGANIZATOR %s je pozvao %s na NRG Race strat liniju!", sendername, giveplayer);
					SendClientMessageToAll(COLOR_LIGHTRED, string);
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, " Niste autorizirani za koristenje ove naredbe !");
			}
		}
		return 1;
	}
	if(strcmp(cmdtext,"/nrgs",true)==0)
	{
    MoveObject(gate2,-1983.595093, 845.671875, 42.480431,50.000);
		return 1;
	}
	if(strcmp(cmdtext,"/nrgp",true)==0)
	{
    MoveObject(gate2,-1983.659912, 845.697510, 44.980431,50.000);
		return 1;
	}
	if(strcmp(cmdtext,"/nrgo",true)==0)
	{
    MoveObject(gate1,-1991.512939, 884.430969, 40.476517,5);
		return 1;
	}
	if(strcmp(cmdtext,"/nrgz",true)==0)
	{
    MoveObject(gate1,-1991.581177, 884.492920, 47.201939,5);
		return 1;
	}
	
	if(strcmp(cmd, "/gotonrg", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if(PlayerInfo[playerid][pAdmin] >= 3)
			{
				if (GetPlayerState(playerid) == 2)
				{
					new tmpcar = GetPlayerVehicleID(playerid);
					SetVehiclePos(tmpcar, -1990.8082,845.3881,45.6682);
					TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
				}
				else
				{
					SetPlayerPos(playerid, -1990.8082,845.3881,45.6682);
				}
				SendClientMessage(playerid, COLOR_GRAD1, "  Teleportiran si !");
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, " Nisi autoriziran za koristenje te komande!");
			}
		}
		return 1;
	}

this is all script of race JUST NRG RACE !!!!!!!
Reply
#9

i said the errors lines not the all script
Reply
#10

it don't have errors that's why i asked



but i see what is wrong lock
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)