[HELP]/robbar command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]/robbar command (
/showthread.php?tid=203156)
[HELP]/robbar command -
Leon_Rahil! - 26.12.2010
I've got two questions:
1.) How can I make it so you can't spam a /robbar command?
2.) How can I show the amount of money robbed from a store?
So far, I've made a working /robbar command, here's the script:
Код:
CMD:robbar(playerid, params[])
{
#pragma unused params
if (gTeam[playerid] == TEAM_CIVI)
{
if (GetPlayerInterior(playerid) == 11 || IsPlayerInRangeOfPoint(playerid, 2, 496.8070, -76.0364, 998.7578))
{
new pName[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizeof(str), "|_ROBBERY_|: %s has just robbed a bar!", pName);
SendClientMessageToAll(COLOR_GREEN, str);
GivePlayerMoney(playerid, random(400000));
SetTimer("Unrobbable",6000,1);
}
}
}
forward Unrobbable();
public Unrobbable()
{
new
x = 6000;
while(x > 6000)
{
x++;
}
return 0;
}
NOTE: This is kind of like an extra bonus thing you could help me with. Whenever I input the command whilst in the checkpoint, I get the amount of money, yet I also get SERVER: Unknown Command.
Re: [HELP]/robbar command -
Jochemd - 26.12.2010
1) Use a timer and variable
2) Use format and show how much money is robbed (you can use random, for example, to rob random money)
Re: [HELP]/robbar command -
Jochemd - 26.12.2010
pawn Код:
GivePlayerMoney(playerid, rand =random(400000));
Ever tried compiling that? XD
pawn Код:
rand = random(400000);
GivePlayerMoney(playerid,rand);
Re: [HELP]/robbar command -
Leon_Rahil! - 26.12.2010
Thanks, everyone. But I've still got one last error, it's not showing the exact amount when you rob it.