Jump to content
  • 0

OnPlayerEnterRaceCheckpoint.....


xxSPEEDYxx

Question

Salls deci am scriptat in GM PRace System si am o problema la OnPlayerEnterRaceCheckpoint imi da aceste errori:

C:\Documents and Settings\user\My Documents\RDU&FS&Maps&Servers\RDU\gamemodes\RDU.pwn(8878) : error 001: expected token: "-identifier-", but found "-integer value-"
C:\Documents and Settings\user\My Documents\RDU&FS&Maps&Servers\RDU\gamemodes\RDU.pwn(8947) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\user\My Documents\RDU&FS&Maps&Servers\RDU\gamemodes\RDU.pwn(8947) : warning 215: expression has no effect
C:\Documents and Settings\user\My Documents\RDU&FS&Maps&Servers\RDU\gamemodes\RDU.pwn(8955) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\user\My Documents\RDU&FS&Maps&Servers\RDU\gamemodes\RDU.pwn(8955) : warning 215: expression has no effect
si acesta este codul...
public OnPlayerEnterRaceCheckpoint(playerid)
{
 if(Giocatore[playerid][IdGara]==-1) return 1;
 new g=Giocatore[playerid][IdGara];
 new c=Giocatore[playerid][Checkpoint];
 if(Gara[Giocatore[playerid][IdGara]][Avviata]==0) return 1;
 SuonoGiocatore(playerid,1138);
 //==============SECHECKPOINT==ULTIMO
 if(Giocatore[playerid][Checkpoint]==Gara[Giocatore[playerid][IdGara]][NumeroCheckpoint])
  {
  //===========SEGIRO=ULTIMO
  if(Giocatore[playerid][Giro]==Gara[Giocatore[playerid][IdGara]][Giri])
    {
    GetPlayerName(playerid,nome,sizeof(nome));
    Gara[Giocatore[playerid][IdGara]][Podio]++;
    if(Giocatore[playerid][Tempo]<Gara[Giocatore[playerid][IdGara]][Record])
    {
    new Minuti=floatround(Giocatore[playerid][Tempo]/60);
    new Secondi=Giocatore[playerid][Tempo]-(Minuti*60);
    format(stringa,sizeof(stringa),"[RECORD:] Player:{8ECE46}%s{FFFFFF} Track: {446ED1}%s{FFFFFF} Record: {C14124}%02d:%02d",nome,Gara[Giocatore[playerid][IdGara]][Nome],Minuti,Secondi);
	SendClientMessageToAll(BIANCO,stringa);
	Gara[Giocatore[playerid][IdGara]][Record]=Giocatore[playerid][Tempo];
    format(Gara[Giocatore[playerid][IdGara]][GiocatoreRecord],25,nome);
    }
	if(!Gara[Giocatore[playerid][IdGara]][Inseguimento])
	{
	format(stringa,sizeof(stringa),"[RACE:] {8ECE46}%s{FFFFFF} finish the race. Position: {C14124}%d",nome,Gara[Giocatore[playerid][IdGara]][Podio]);
	GivePlayerMoney(playerid,floatround(Gara[Giocatore[playerid][IdGara]][Costo]*Gara[Giocatore[playerid][IdGara]][PartecipantiPronti]/Gara[Giocatore[playerid][IdGara]][Podio]));
    SendClientMessageToAll(BIANCO,stringa);
	}
	if(Gara[Giocatore[playerid][IdGara]][Inseguimento])
	{
	for(new i=0;i<MAX_PLAYERS;i++)
	 {
	 if(Giocatore[i][IdGara]==Giocatore[playerid][IdGara] && i!=playerid)
	  {
	  if(Giocatore[playerid][Punti]>=Giocatore[i][Punti])
		{
	    GetPlayerName(playerid,nome,sizeof(nome));
	    format(stringa,sizeof(stringa),"[RACE:] {8ECE46}%s{FFFFFF} wons the chase race with {C14124}%d{FFFFFF} points.",nome,Giocatore[playerid][Punti]);
        SendClientMessageToAll(BIANCO,stringa);
	    GivePlayerMoney(playerid,Gara[Giocatore[playerid][IdGara]][Costo]*2);
		}
	  if(Giocatore[playerid][Punti]<Giocatore[i][Punti])
		{
	    GetPlayerName(i,nome,sizeof(nome));
	    format(stringa,sizeof(stringa),"[RACE:] {8ECE46}%s{FFFFFF} wons the chase race with {C14124}%d{FFFFFF} points.",nome,Giocatore[i][Punti]);
        SendClientMessageToAll(BIANCO,stringa);
        GivePlayerMoney(i,Gara[Giocatore[playerid][IdGara]][Costo]*2);
		}
      LasciaGara(i);
	  }
	 }
	}
    DisablePlayerRaceCheckpoint(playerid);
    LasciaGara(playerid);
    return 1;
    }
  //========SEGIRO!=ULTIMO
  else
    {
    Giocatore[playerid][Giro]++;
	SetPlayerRaceCheckpoint(playerid,0,CheckpointGara[g][0][CXPos],CheckpointGara[g][0][CYPos],CheckpointGara[g][0][CZPos],CheckpointGara[g][1][CXPos],CheckpointGara[g][1][CYPos],CheckpointGara[g][1][CZPos],9);
	Giocatore[playerid][Checkpoint]=0;
	format(stringa,sizeof(stringa),"Laps: %d/%d",Giocatore[playerid][Giro],Gara[Giocatore[playerid][IdGara]][Giri]);
	TextDrawSetString(TextGiriContatore[playerid],stringa);
	return 1;
	}
  }
  //=========SECHECKPOINTNORMALE
 if(Giocatore[playerid][Checkpoint]<Gara[Giocatore[playerid][IdGara]][NumeroCheckpoint]-1)
  {
  Giocatore[playerid][Checkpoint]++;
  c=Giocatore[playerid][Checkpoint];
  SetPlayerRaceCheckpoint(playerid,0,CheckpointGara[g][c][CXPos],CheckpointGara[g][c][CYPos],CheckpointGara[g][c][CZPos],CheckpointGara[g][c+1][CXPos],CheckpointGara[g][c+1][CYPos],CheckpointGara[g][c+1][CZPos],9);
  return 1;
  }
 //=========SECHECKPOINTFINALE
 else if(Giocatore[playerid][Checkpoint]==Gara[Giocatore[playerid][IdGara]][NumeroCheckpoint]-1)
  {
  Giocatore[playerid][Checkpoint]++;
  c=Giocatore[playerid][Checkpoint];
  SetPlayerRaceCheckpoint(playerid,1,CheckpointGara[g][c][CXPos],CheckpointGara[g][c][CYPos],CheckpointGara[g][c][CZPos],CheckpointGara[g][c+1][CXPos],CheckpointGara[g][c+1][CYPos],CheckpointGara[g][c+1][CZPos],9);
  return 1;
  }
 return 0;
}

Fara reclama in semnatura!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.