Adding countdown to this cmd
#4

Thank you,it compiles with no errors.Here is my rob cmd now:

pawn Код:
CMD:rob(playerid, params[])
{
    if(GetPVarInt(playerid,"RobTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"Please wait 60 seconds before rob again.");
    SetPVarInt(playerid,"RobTime",GetTickCount()+60000);
    new plwl = GetPlayerWantedLevel(playerid);
    plwl = GetPlayerWantedLevel(playerid);
    SetPlayerWantedLevel(playerid,plwl +2);
    pRobTimerID[playerid] = SetTimerEx("pRobTimer", 1000, true, "i", playerid);
    pRobCount[playerid] = 30;
    new string[135];
    format(string, sizeof(string), "- ROBBERY IN PROGRESS - Wanted Level %d - Police have been advised.",plwl);
    SendClientMessage(playerid,red,string);
    GameTextForPlayer(playerid, "Robbery ~r~in progress.Do ~r~NOT leave the icon.", 30000, 5);
    new robmoney = 10500 + random(50000);
    GivePlayerMoney(playerid,robmoney);
    new string2[135];
    format(string2, sizeof(string2), "- SUCCESS ROBBERY - Wanted Level %d - Robbed %i$",plwl,robmoney);
    SendClientMessage(playerid,red,string2);
    GameTextForPlayer(playerid, "Robbery ~r~COMPLETE.", 3000, 5);
    SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
    new string3[135];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string3, sizeof(string3), "- ROBBERY - %s (%d) has robbed %i$ from ",name,playerid,robmoney);
    SendClientMessageToAll(COLOR_WHITE,string3);
    return true;
}
But the timer doesn't work,it shows the "Robbery complete" gametext,that need to show AFTER the timer finishes...
Reply


Messages In This Thread
Adding countdown to this cmd - by Face9000 - 26.01.2012, 20:18
Re: Adding countdown to this cmd - by Universal - 26.01.2012, 20:34
Re: Adding countdown to this cmd - by MP2 - 26.01.2012, 20:38
Re: Adding countdown to this cmd - by Face9000 - 26.01.2012, 20:49
Re: Adding countdown to this cmd - by MP2 - 26.01.2012, 20:50
Re: Adding countdown to this cmd - by Face9000 - 26.01.2012, 21:00

Forum Jump:


Users browsing this thread: 1 Guest(s)