cmd timer
#6

Quote:
Originally Posted by FailerZ
Посмотреть сообщение
Add/Replace to the following
PHP код:
CMD:steal(playerid)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz); //Get the player position when he starts to rob
    
StealTimer[playerid] = SetTimerEx("StealFromPlayer"1000true"ifff"playeridxyz); //Passed the float of the coordinations
    
return 1;
}
forward StealFromPlayer(playeridFloat:xFloat:yFloat:z); //Notice you have to forward them and add Float: tag before them
public StealFromPlayer(playeridFloat:xFloat:yFloat:z//Here too
{
    if(!
IsPlayerInRangeOfPoint(playerid1.0xyz)) //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"10004);
        return 
1//we return 1 so it doesn't continue the codes below
    
}

When I steal it's give me the staff and after start the timer... what to do? and thanks!
Reply


Messages In This Thread
cmd timer - by CheckItOut - 20.07.2017, 07:49
Re: cmd timer - by coool - 20.07.2017, 07:55
Re: cmd timer - by FailerZ - 20.07.2017, 08:12
Re: cmd timer - by CheckItOut - 20.07.2017, 08:29
Re: cmd timer - by FailerZ - 20.07.2017, 08:46
Re: cmd timer - by CheckItOut - 20.07.2017, 08:47
Re: cmd timer - by FailerZ - 20.07.2017, 08:50

Forum Jump:


Users browsing this thread: 1 Guest(s)