#include <a_samp>
new playername[MAX_PLAYER_NAME];
new cpa=4; //This is the number of checkpointsallocated to the script
new cpc=0; //This is the counterpointcounter at 0
new Float:CP[cpa][4]=
{
{1626.1899,-1139.0016,27.2013}, //checkpoint one
{2284.6992,-1047.2119,52.0577}, //checkpoint two
{2877.8887,-1591.7875,22.2218}, //checkpoint three
{2326.4048,-2426.3743,-0.6051} //checkpoint 4
};
main()
{
print("\n----------------------------------");
print(" Race across SA, V2");
print("----------------------------------\n");
}
public OnGameModeInit()
{
print("GameModeInit()");
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
printf("OnPlayerRequestClass(%d, %d)", playerid, classid);
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnGameModeExit()
{
print("GameModeExit()");
return 1;
}
public OnPlayerConnect(playerid)
{
printf("OnPlayerConnect(%d)", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
printf("OnPlayerDisconnect(%d)", playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid,CP[cpc][1],CP[cpc][2],CP[cpc][3],3);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
printf("OnVehicleSpawn(%d)", vehicleid);
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
printf("OnVehicleDeath(%d, %d)", vehicleid, killerid);
return 1;
}
public OnPlayerText(playerid)
{
printf("OnPlayerText(%d)", playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/mycommand", true)==0)
{
/* Do something here */
return 1;
}
return 0;
}
public OnPlayerInfoChange(playerid)
{
printf("OnPlayerInfoChange(%d)");
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger);
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
GameTextForPlayer(playerid,"Well done, now to the next one",5000,2);
DisablePlayerCheckpoint(playerid);
cpc++; //This should advance the counter by one
if (cpa==cpc) //Should Check if its the last checkpoint
{
GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
new message[128];
format(message,128,"%s MADE IT INTO THE CHECKPOINT FIRST",playerid);
GameTextForAll(message,3000,1);
GameModeExit();
}
return 1;
}