A problem with my robbery system
#3

New code:
pawn Код:
forward HasRobbedCityhall(playerid);
forward HasRobbedCityhall2(playerid);

new HasRobbedCityhallRecently[MAX_PLAYERS];

public HasRobbedCityhall(playerid)
{
    TogglePlayerControllable(playerid, 1);
    SetTimer("HasRobbedCityhall2", 300000, false);
    new string[128];
    new mrand = random(25000);
    new ID;
    format(string,sizeof(string),"Player %s(%d) has robbed $%i from the city hall.",PlayerName(ID),ID, mrand);
    SendClientMessageToAll(COL_WHITE, string);
    SetPlayerWantedLevel(ID, 1);
    GivePlayerMoney(ID, mrand);
    WantedColor(ID);
}
public HasRobbedCityhall2(playerid)
{
    HasRobbedCityhallRecently[playerid] = 0;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_WALK && (IsPlayerInRangeOfPoint(playerid,3.0,355.0123,166.7394,1008.3793) && gTeam[playerid] == TEAM_CRIMINAL))
    {
    SendClientMessage(playerid, COL_WHITE, "You are now attempting to rob the city hall. Please wait for 30 seconds.");
    HasRobbedCityhallRecently[playerid] = 1;
    SetTimerEx("HasRobbedCityhall", 30000, false,"i",playerid);
    TogglePlayerControllable(playerid, 0);
    }
}
Still doesnt work..

EDIT: Changed "ID" to "playerid", testing if it worked now.
EDIT: Abovesaid worked. Problem solved.
Reply


Messages In This Thread
A problem with my robbery system - by SKAzini - 25.06.2012, 09:49
Re: A problem with my robbery system - by [MM]RoXoR[FS] - 25.06.2012, 10:01
Re: A problem with my robbery system - by SKAzini - 25.06.2012, 10:41

Forum Jump:


Users browsing this thread: 1 Guest(s)