if(strcmp(cmd, "/findman", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /findman [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Find yourself!"); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 0);
SetTimer("makav", 1000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Invalid Name/ID !");
}
return 1;
}
public makav(giveplayerid, playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Folat:x, Folat:y, Folat:z;
GetPlayerPos(giveplayerid, x, y, z);
SetPlayerCheckpoint(playerid, x,y,z, 0);
return 1;
}
}
SetPlayerCheckpoint(giveplayerid, X,Y,Z, 2);
|
for(new i = 0; i < MAX_PLAYERS; i++) { new Folat , Folat:y, Folat:z;GetPlayerPos(giveplayerid, x, y, z); SetPlayerCheckpoint(playerid, x,y,z, 0); return 1; } |
forward chkptimer();
..
SetTimer("chkptimer()",250,true);
..
public chkptimer()
{
for(new idx=1;idx<=MAX_CHECKPOINTS;idx++)
{ for(new id=0;id<=MAX_PLAYERS;id++)
{ if(IsPlayerConnected(id))
{ if(IsPlayerInCheckpoint(id))
{ OnPlayerEnterCheckpoint(id,idx);} else {OnPlayerLeaveCheckpoint(id,idx);}
}
}
}
}