A set-nek set a multideje.. De igazából tökmindegy
A \"PosSetted\" -t megcsinálom \"PlayerTeleported\" -nek.
Szóval...
script elejére:
#define func%0(%1) forward%0(%1); public%0(%1)
new Float:oldX[MAX_PLAYERS],
Float:oldY[MAX_PLAYERS],
Float:oldZ[MAX_PLAYERS],
Float:newX[MAX_PLAYERS],
Float:newY[MAX_PLAYERS],
Float:newZ[MAX_PLAYERS]
;
OnFilterScriptInit vagy OnGameModeInit alá:
SetTimer(\"CheckPos\",1000,1);
OnPlayerConnect alá:
oldX[playerid] = 0;
oldY[playerid] = 0;
oldZ[playerid] = 0;
newX[playerid] = 0;
newY[playerid] = 0;
newZ[playerid] = 0;
A többit meg valahova script legvégére mondjuk:
func CheckPos()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
oldX = newX;
oldY = newY;
oldZ = newZ;
GetPlayerPos(i,newX,newY,newZ);
}
return 1;
}
stock PlayerTeleported(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,40.0,oldX,oldY,oldZ))
return false;
else if(!IsPlayerInRangeOfPoint(playerid,40.0,oldX,oldY,oldZ))
return true;
}
És akkor így kérdezheted le h teleportált-e a játékos:
if(PlayerTeleported(playerid))
{
}