A simple timer & one question -
_Khaled_ - 07.09.2012
Hello,
I've tried adding a timer, searched wiki, but still didn't get it :/
I want add 15 seconds to the robbery.. with some gametext showing it..
There's another thing, in
it's showing random letters, arabic english, symbols,, anyone know what to replace it with?
pawn Код:
if(listitem == 3) //Rob 24/7
{
new frand =random(10);
new mrand =random(8000);
if(gTeam[playerid] != TEAM_CIVIL)
{
SendClientMessage(playerid,COLOR_RED,"Law enforcement officers cannot rob anything.");
return 1;
}
if(frand <= 6)
{
SendClientMessage(playerid, COLOR_RED, "You've attempted to rob 24/7 in the strip (LV), but failed.");
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has attempted to rob the 24/7 in the strip (LV).",pname, playerid);
SendCopMessage(COLOR_BLUE, string);
SendCIAMessage(COLOR_BLUE, string);
SendArmyMessage(COLOR_GREEN, string);
return 1;
}
GivePlayerMoney(playerid, mrand);
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "You've successfully robbed the 24/7 in the strip (LV), and got away with %s",mrand);
SendClientMessage(playerid,COLOR_GREEN, string);
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "[ROBBERY] {FFFFFF}%s(%d) {F81414}has robbed the 24/7 in {FFFFFF}the strip (LV),{F81414} and got away with{FFFFFF} %s",pname, playerid, mrand);
SendClientMessageToAll(COLOR_RED, string);
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has robbed the 24/7 in the strip (LV), and got away with %s",pname, playerid, mrand);
SendCopMessage(COLOR_BLUE, string);
SendCIAMessage(COLOR_BLUE, string);
SendArmyMessage(COLOR_GREEN, string);
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(string,sizeof(string),"%s(%d) has robbed the 24/7 in the stip (LV), and got away with %s",pname,playerid,mrand);
IRC_GroupSay(groupID,ADMIN_CHANNEL,string);
IRC_GroupSay(groupID,IRC_CHANNEL,string);
return 1;
}
Anyone? :/
Re: A simple timer & one question -
_Khaled_ - 07.09.2012
Tried %d, still the same problem..
Respuesta: A simple timer & one question -
HydraX - 07.09.2012
Did you set %d to ALL the formats?
Re: A simple timer & one question -
_Khaled_ - 07.09.2012
no
only for mrand
pawn Код:
if(listitem == 3) //Rob 24/7
{
new frand =random(10);
new mrand =random(11000);
if(gTeam[playerid] != TEAM_CIVIL)
{
SendClientMessage(playerid,COLOR_RED,"Law enforcement officers cannot rob anything.");
return 1;
}
if(frand <= 4)
{
SendClientMessage(playerid, COLOR_RED, "You've attempted to rob 24/7 in old venturas strip (LV), but failed.");
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has attempted to rob the 24/7 in old venturas strip (LV).",pname, playerid);
SendCopMessage(COLOR_BLUE, string);
SendCIAMessage(COLOR_BLUE, string);
SendArmyMessage(COLOR_GREEN, string);
return 1;
}
GivePlayerMoney(playerid, mrand);
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "You've successfully robbed the 24/7 in old venturas strip (LV), and got away with %d",mrand);
SendClientMessage(playerid,COLOR_GREEN, string);
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "[ROBBERY] {FFFFFF}%s(%d) {F81414}has robbed the 24/7 in {FFFFFF}old venturas strip (LV),{F81414} and got away with {FFFFFF}%d",pname, playerid, mrand);
SendClientMessageToAll(COLOR_RED, string);
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string), "[LAW ENFORCEMENT RADIO] %s(%d) has robbed the 24/7 in old venturas strip (LV), and got away with %d",pname, playerid, mrand);
SendCopMessage(COLOR_BLUE, string);
SendCIAMessage(COLOR_BLUE, string);
SendArmyMessage(COLOR_GREEN, string);
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(string,sizeof(string),"%s(%d) has robbed the 24/7 in old venturas strip (LV), and got away with %d",pname,playerid,mrand);
IRC_GroupSay(groupID,ADMIN_CHANNEL,string);
IRC_GroupSay(groupID,IRC_CHANNEL,string);
return 1;
}
Re: A simple timer & one question -
_Khaled_ - 08.09.2012
Another bump :/
I need to fix the %d",mrand); thing..