04.07.2013, 07:20
I see ur RobFail, and it's useless...
I've edited it a little bit. Didn't test but it should work.
And btw, nice userbars :>
I've edited it a little bit. Didn't test but it should work.
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);
robtime = SetTimer("robtimer",1000,true);
}
else
{
return SCM(playerid,-1,"You are not in a rob point");
}
}
return 1;
}
forward robtimer(playerid);
public robtimer(playerid)
{
for(new i=0; i<MAX_PICK; i++)
{
CountDownVar--;
new str[128];
format(str, sizeof(str), "Count Down: %d",CountDownVar);
GameTextForPlayer(playerid,str,1000,6);
if(CountDownVar == 0)
{
if(!IsPlayerInRangeOfPoint(playerid,1.0,PickInfo[i][pX], PickInfo[i][pY], PickInfo[i][pZ]) || GetPlayerVirtualWorld(playerid) != PickInfo[i][pVw] || GetPlayerInterior(playerid) != PickInfo[i][pInt])
{
KillTimer(robtime);
ClearAnimations(playerid);
CountDownVar = 15;
return SCM(playerid,-1, "[ROBBERY]: Robbery has failed");
}
new rand = random(999);
GiveDrichMoney(playerid,rand);
format(str,128," %s has robbed %i",GetName(playerid),rand);
SCM(playerid,-1,str);
ClearAnimations(playerid);
KillTimer(robtime);
CountDownVar = 15;
}
}
return 1;
}