Help compile failed??
#1

Help compile failed
Код:
{
			  if (DerbyStarted != 2)
			  {
			    SendClientMessage(playerid, COLOR_GRAD1, "You can't finish a Derby that didn't /derby start yet");
			    return 1;
			  }
			  DerbyStarted = 0;
			  new DerbyWinner = 255;
			  new derbyhealth = 0;
			  new carssurvived = 0;
			  new tmphealth;
			  new derbyid;
			  for (i=0; i<MAX_PLAYERS; i++)
			  {
			    if (DerbyPlayers[i] == 1)
			    {
						derbyid = GetPlayerVehicleID(i);
						if (IsPlayerConnected(i) && IsPlayerInAnyVehicle(playerid) && GetVehicleModel(derbyid) == 504)
						{
						  carssurvived++;
						  GetVehicleHealth(derbyid, tmphealth);
						  if (tmphealth > derbyhealth)
						  {
						    derbyhealth = tmphealth;
						    DerbyWinner = i;
						  }
						}
			    }
			  }
			  format(string, sizeof(string), "A Derby has finished. %d cars survived.", carssurvived);
			  SendClientMessageToAll(TEAM_ORANGE_COLOR, string);
			  if (DerbyWinner != 255)
			  {
				  GetPlayerName(DerbyWinner, playername, sizeof(playername));
				  format(string, sizeof(string), "Our winner is %s, who is getting $%d.", playername, DerbyPrize);
				  SafeGivePlayerMoney(DerbyWinner, DerbyPrize);
			  }
			  else
			  {
			    format(string, sizeof(string), "No one survived in current Destruction Derby.");
			  }
			  SendClientMessageToAll(TEAM_ORANGE_COLOR, string);
			  return 1;
			}
Код:
osc.pwn(13719) : warning 213: tag mismatch
Why?
_________________________________________________
I am not good English. sorry
Reply
#2

Quote:
Originally Posted by paint36
Help compile failed
Код:
{
			  if (DerbyStarted != 2)
			  {
			    SendClientMessage(playerid, COLOR_GRAD1, "You can't finish a Derby that didn't /derby start yet");
			    return 1;
			  }
			  DerbyStarted = 0;
			  new DerbyWinner = 255;
			  new derbyhealth = 0;
			  new carssurvived = 0;
			  new tmphealth;
			  new derbyid;
			  for (i=0; i<MAX_PLAYERS; i++)
			  {
			    if (DerbyPlayers[i] == 1)
			    {
						derbyid = GetPlayerVehicleID(i);
						if (IsPlayerConnected(i) && IsPlayerInAnyVehicle(playerid) && GetVehicleModel(derbyid) == 504)
						{
						  carssurvived++;
						  GetVehicleHealth(derbyid, tmphealth);
						  if (tmphealth > derbyhealth)
						  {
						    derbyhealth = tmphealth;
						    DerbyWinner = i;
						  }
						}
			    }
			  }
			  format(string, sizeof(string), "A Derby has finished. %d cars survived.", carssurvived);
			  SendClientMessageToAll(TEAM_ORANGE_COLOR, string);
			  if (DerbyWinner != 255)
			  {
				  GetPlayerName(DerbyWinner, playername, sizeof(playername));
				  format(string, sizeof(string), "Our winner is %s, who is getting $%d.", playername, DerbyPrize);
				  SafeGivePlayerMoney(DerbyWinner, DerbyPrize);
			  }
			  else
			  {
			    format(string, sizeof(string), "No one survived in current Destruction Derby.");
			  }
			  SendClientMessageToAll(TEAM_ORANGE_COLOR, string);
			  return 1;
			}
Код:
osc.pwn(13719) : warning 213: tag mismatch
Why?
_________________________________________________
I am not good English. sorry
but its just a warning, are you sure it did not compile?


Код:
213 tag mismatch

 A tag mismatch occurs when:
⋄ assigning to a tagged variable a value that is untagged or that
has a different tag
⋄ the expressions on either side of a binary operator have different
tags
⋄ in a function call, passing an argument that is untagged or that
has a different tag than what the function argument was defined
with
⋄ indexing an array which requires a tagged index with no tag or
a wrong tag name
Reply
#3

'tmphealth' and 'derbyhealth' should be floats.
Reply
#4

You should of asked in the Citywide Roleplay topic,
Change
pawn Код:
new tmphealth;
new derbyhealth;
to
pawn Код:
new Float:tmphealth;
new Float:derbyhealth;
Edit: Damn Donny got it before me
Reply
#5

Thank you and sorry for the mistake
Reply
#6

Quote:
Originally Posted by JeNkStAX
Edit: Damn Donny got it before me
Hehehe, 1 - 0 to Donny
Reply
#7

Quote:
Originally Posted by Donny
Quote:
Originally Posted by JeNkStAX
Edit: Damn Donny got it before me
Hehehe, 1 - 0 to Donny
Haha.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)