05.07.2013, 13:08
how to check if the player moved or not in the point? and where do i put that code in this?....
pawn Код:
CMD:rob(playerid,params[])
{
for(new i=0; i<MAX_PICK; i++)
{
if(IsPlayerInRangeOfPoint(playerid,2,PickInfo[i][pX], PickInfo[i][pY], PickInfo[i][pZ]) && GetPlayerVirtualWorld(playerid) == PickInfo[i][pVw] && GetPlayerInterior(playerid) == PickInfo[i][pInt])
{
ApplyAnimation(playerid, "ROB_BANK", "CAT_SAFE_ROB", 4.0, 1, 0, 0,0, 1);
rt = SetTimer("robtimer",1000,true);
return 1;
}
}
return 1;
}
forward robtimer(playerid);
public robtimer(playerid)
{
CountDownVar--;
new str[128];
format(str, sizeof(str), "Count Down: %d",CountDownVar);
GameTextForPlayer(playerid,str,1000,6);
for(new i=0; i<MAX_PICK; i++)
{
if(CountDownVar == 0)
{
new rand = random(999);
GiveDrichMoney(playerid,rand);
format(str,128," %s has robbed %i",GetName(playerid),rand);
SCM(playerid,-1,str);
ClearAnimations(playerid);
KillTimer(rt);
CountDownVar = 15;
return 1;
}
}
return 1;
}