SA-MP Forums Archive
onplayennter - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: onplayennter (/showthread.php?tid=294888)



onplayennter - marik1322 - 03.11.2011

i try to do that when the first player enter to the check point will get 90k
the second 60k
and the third 30k
but this way not working
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
else if(
race[playerid] == 33)
{
for(new 
0MAX_PLAYERSi++)
{
if(
finish[playerid] == 6)
{
new 
pname[128];
new 
string[126];
DisablePlayerRaceCheckpoint(i);
GetPlayerName(playeridpnamesizeof(pname));
GivePlayerMoney(playerid30000);
format(stringsizeof(string), "[Player] %s is the 3st that end the race and got 30000$."pname);
SendClientMessageToAll(Orangestring);
SetVehicleToRespawn(car);
Enteredrace[i] = 2;
}
if(
finish[playerid] == 5)
{
new 
pname[128];
new 
string[126];
DisablePlayerRaceCheckpoint(playerid);
GetPlayerName(playeridpnamesizeof(pname));
GivePlayerMoney(playerid60000);
format(stringsizeof(string), "[Player] %s is the 2st that end the race and got 60000$."pname);
SendClientMessageToAll(Orangestring);
finish[i] = 6;
}
else
{
new 
pname[128];
new 
string[126];
DisablePlayerRaceCheckpoint(playerid);
GetPlayerName(playeridpnamesizeof(pname));
GivePlayerMoney(playerid90000);
format(stringsizeof(string), "[Player] %s is the 1st that end the race and got 90000$."pname);
SendClientMessageToAll(Orangestring);
finish[i] = 5;
}
}
}




Re: onplayennter - LZLo - 03.11.2011

PHP код:
public OnPlayerEnterRaceCheckpoint(playerid

if(
race[playerid] == 33

for(new 
0MAX_PLAYERSi++) 

if(
finish[playerid] == 6

new 
pname[128]; 
new 
string[126]; 
DisablePlayerRaceCheckpoint(i); 
GetPlayerName(playeridpnamesizeof(pname)); 
GivePlayerMoney(playerid30000); 
format(stringsizeof(string), "[Player] %s is the 3st that end the race and got 30000$."pname); 
SendClientMessageToAll(Orangestring); 
SetVehicleToRespawn(car); 
Enteredrace[i] = 2

else if(
finish[playerid] == 5

new 
pname[128]; 
new 
string[126]; 
DisablePlayerRaceCheckpoint(playerid); 
GetPlayerName(playeridpnamesizeof(pname)); 
GivePlayerMoney(playerid60000); 
format(stringsizeof(string), "[Player] %s is the 2st that end the race and got 60000$."pname); 
SendClientMessageToAll(Orangestring); 
finish[i] = 6

else 

new 
pname[128]; 
new 
string[126]; 
DisablePlayerRaceCheckpoint(playerid); 
GetPlayerName(playeridpnamesizeof(pname)); 
GivePlayerMoney(playerid90000); 
format(stringsizeof(string), "[Player] %s is the 1st that end the race and got 90000$."pname); 
SendClientMessageToAll(Orangestring); 
finish[i] = 5




try this