07.07.2009, 22:20
i'de probably do it more like this, although i havnt tested it yet, so you will have to let me know if its not working right
pawn Код:
new TotalGrass[MAX_PLAYERS];
public OnPlayerEnterRaceCheckpoint(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if (GetVehicleModel(vehicleid) == 572)
{
if (PlayerToPoint(4, playerid, 779.9626, -1259.1793, 13.5719))
{
TotalGrass[playerid] += 5;
new NeededGrass = 200-TotalGrass[playerid];
new gString[80];
format(gString, sizeof(gString),"(5 GRASS COLLECTED) You Have A Total Of %i Grass, You Still Need %i More.",TotalGrass,NeededGrass);
SendClientMessage(playerid,0xBBFFFFFF,gString);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0xBBFFFFFF, "You Have Arived At Checkpoint One! Head To The Next Checkpoint!");
SetPlayerRaceCheckpoint(playerid, 2, X, Y, Z, 0, 0, 0, 6.0);// Set the X, Y, Z
}
else if (PlayerToPoint(4, playerid, X, Y, Z))// Set the X, Y, Z
{
TotalGrass[playerid] += 5;
new NeededGrass = 200-TotalGrass[playerid];
new gString[80];
format(gString, sizeof(gString),"(5 GRASS COLLECTED) You Have A Total Of %i Grass, You Still Need %i More.",TotalGrass,NeededGrass);
SendClientMessage(playerid,0xBBFFFFFF,gString);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0xBBFFFFFF, "You Have Arived At Checkpoint Two! Head To The Next Checkpoint!");
SetPlayerRaceCheckpoint(playerid, 2, X, Y, Z, 0, 0, 0, 6.0);// Set the X, Y, Z
}
return 1;
}
return 1;
}