04.11.2015, 07:27
pawn Код:
new CheckPoint[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
CheckPoint[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
CheckPoint[playerid] = 0;
return 1;
}
COMMAND:gunshop(playerid, cmdtext)
{
new string[128], xpos, ypos, zpos, veh;
if(CheckPoint[playerid] == 1) return SendClientMessage(playerid, -1, "You already have an active checkpoint!");
GetPlayerPos(playerid, xpos, ypos, zpos);// gets their current pos
veh = GetPlayerVehicleID(playerid); // gets the vehicle they are driving.
SetPlayerCheckpoint(playerid, xpos,ypoz,zpos); // Sets the checkpoint as their current pos
DestroyVehicle(veh); // destroys the vehicle they are driving.
CheckPoint[playerid] = 1;
return 1;
}