Originally Posted by еddy
To create the "red markers" A.K.A. checkpoints, you must use SetPlayerCheckpoint. When the player enters the checkpoint (IsPlayerInCheckpoint), you'll have to disable the old checkpoint (DisablePlayerCheckpoint), and create a new check point (SetPlayerCheckpoint).
|
enum PlayerInfo
{
checkpoints
}
new PlayerData[MAX_PLAYERS][PlayerInfo];
PlayerData[playerid][checkpoints]++;
#include <a_samp>
enum PlayerInfo
{
checkpoints
}
new PlayerData[MAX_PLAYERS][PlayerInfo];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/test",true))
{
if(IsPlayerInCheckpoint(playerid))
{
PlayerData[playerid][checkpoints]++;
return 1;
}
SendClientMessageToAll(0xFFFFAAAA, "Test Successfull");
return 1;
}
return 0;
}
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;
}
Originally Posted by happyface
pawn Код:
|