19.01.2018, 00:56
Ok so i'm trying to make actors to put inside ammunations/247s which allow players to rob the store by aiming at the actor. My problem is that once I aim at the actor and begin the robbery, I can't figure out how to make the robbery cancel itself if I stop aiming.
Anybody have any ideas how to fix this?
Anybody have any ideas how to fix this?
Код:
public OnPlayerTargetActor(playerid, newtarget, oldtarget) { if (newtarget == prostitutebot) { ApplyActorAnimation(newtarget, "PED", "handsup", 4.1, 0, 0, 0, 1, 0); if(GetPVarInt(playerid,"RobTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait 5 minutes before another robbery."); if(gTeam[playerid] == TEAM_COP) return SendClientMessage(playerid, red, "Cops cannot rob stores"); pRobTimerID[playerid] = SetTimerEx("pRobTimer", 1000, true, "i", playerid); pRobCount[playerid] = 31; SetPVarInt(playerid,"RobTime",GetTickCount()+300000); } if (oldtarget != INVALID_ACTOR_ID) { ClearActorAnimations(oldtarget); } }