This cmd crashes pawno
#5

pawn Код:
new Variable[500]
...creates an array starting at cell [0] upto [499], thats 500 together.
if you use [MAX_PLAYERS] in any loop, it ill be an "out of bounds" error. your simple mistake was the playerid instead of MAX_PLAYERS:
pawn Код:
dcmd_rob(playerid,params[])
{
    if((GetTickCount() - robtime[playerid]) < 120000)) return SendClientMessage(playerid,0xff0000ff,"You have to wait.");
    if(IsPlayerInRangeOfPoint(playerid, 10.0000, 0.0000,0.0000,0.0000))
    {
        new string[120], playerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
        robtime[playerid] = GetTickCount();
        format(string, sizeof(string), "%s Is Robbing .....etc", playerName);
        SendClientMessageToAll(0xFFFFFFFF, string);
        SetPlayerWantedLevel(playerid, 6);
        GivePlayerMoney(playerid, 10000);
    }
    return 1;
}
btw: let a player start to rob, then /q, then let another player connect on the same id, and let him try to rob again. the robtime[playerid] gets reset at OnPlayerDisconnect?
oh, and where are the coodrinates and the radius for
Код:
if(IsPlayerInRangeOfPoint(playerid, RANGE, COORDINATES))
? its at blueberry acres now hehe
Reply


Messages In This Thread
This cmd crashes pawno - by Face9000 - 03.01.2012, 20:32
Re: This cmd crashes pawno - by Stigg - 03.01.2012, 20:34
Re: This cmd crashes pawno - by geerdinho8 - 03.01.2012, 21:38
Re: This cmd crashes pawno - by fiki574 - 03.01.2012, 21:55
Re: This cmd crashes pawno - by Babul - 03.01.2012, 22:47

Forum Jump:


Users browsing this thread: 1 Guest(s)