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 i = 0; i < MAX_PLAYERS; i++)
{
if(finish[playerid] == 6)
{
new pname[128];
new string[126];
DisablePlayerRaceCheckpoint(i);
GetPlayerName(playerid, pname, sizeof(pname));
GivePlayerMoney(playerid, 30000);
format(string, sizeof(string), "[Player] %s is the 3st that end the race and got 30000$.", pname);
SendClientMessageToAll(Orange, string);
SetVehicleToRespawn(car);
Enteredrace[i] = 2;
}
if(finish[playerid] == 5)
{
new pname[128];
new string[126];
DisablePlayerRaceCheckpoint(playerid);
GetPlayerName(playerid, pname, sizeof(pname));
GivePlayerMoney(playerid, 60000);
format(string, sizeof(string), "[Player] %s is the 2st that end the race and got 60000$.", pname);
SendClientMessageToAll(Orange, string);
finish[i] = 6;
}
else
{
new pname[128];
new string[126];
DisablePlayerRaceCheckpoint(playerid);
GetPlayerName(playerid, pname, sizeof(pname));
GivePlayerMoney(playerid, 90000);
format(string, sizeof(string), "[Player] %s is the 1st that end the race and got 90000$.", pname);
SendClientMessageToAll(Orange, string);
finish[i] = 5;
}
}
}
}
Re: onplayennter -
LZLo - 03.11.2011
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(race[playerid] == 33)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(finish[playerid] == 6)
{
new pname[128];
new string[126];
DisablePlayerRaceCheckpoint(i);
GetPlayerName(playerid, pname, sizeof(pname));
GivePlayerMoney(playerid, 30000);
format(string, sizeof(string), "[Player] %s is the 3st that end the race and got 30000$.", pname);
SendClientMessageToAll(Orange, string);
SetVehicleToRespawn(car);
Enteredrace[i] = 2;
}
else if(finish[playerid] == 5)
{
new pname[128];
new string[126];
DisablePlayerRaceCheckpoint(playerid);
GetPlayerName(playerid, pname, sizeof(pname));
GivePlayerMoney(playerid, 60000);
format(string, sizeof(string), "[Player] %s is the 2st that end the race and got 60000$.", pname);
SendClientMessageToAll(Orange, string);
finish[i] = 6;
}
else
{
new pname[128];
new string[126];
DisablePlayerRaceCheckpoint(playerid);
GetPlayerName(playerid, pname, sizeof(pname));
GivePlayerMoney(playerid, 90000);
format(string, sizeof(string), "[Player] %s is the 1st that end the race and got 90000$.", pname);
SendClientMessageToAll(Orange, string);
finish[i] = 5;
}
}
}
}
try this