20.07.2017, 08:46
Add/Replace to the following
PHP код:
CMD:steal(playerid)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z); //Get the player position when he starts to rob
StealTimer[playerid] = SetTimerEx("StealFromPlayer", 1000, true, "ifff", playerid, x, y, z); //Passed the float of the coordinations
return 1;
}
forward StealFromPlayer(playerid, Float:x, Float:y, Float:z); //Notice you have to forward them and add Float: tag before them
public StealFromPlayer(playerid, Float:x, Float:y, Float:z) //Here too
{
if(!IsPlayerInRangeOfPoint(playerid, 1.0, x, y, z)) //Here we check every after every second passed if the player in the range of his old position. decrese the range (1.0) to lesser number if you don't want him to move at all
{
KillTimer(StealTimer[playerid]); //As always kill the timer
GameTextForPlayer(playerid, "~r~~h~Failed to rob", 1000, 4);
return 1; //we return 1 so it doesn't continue the codes below
}
}