15.08.2013, 03:05
This is the general starter of what you want.
pawn Код:
#include <a_samp>
#include <zcmd>
new BRobbery[MAX_PLAYERS];
new string[128];
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFF4000FF
public OnPlayerConnect(playerid)
{
BRobbery[playerid] = 0;
return 1;
}
CMD:robbank(playerid,params[])
{
new pName[MAX_PLAYER_NAME];
for(new i = 0; i<MAX_PLAYERS; i++)
{
BRobbery[i] = 1;
}
format(string,sizeof(string),"[BREAKING NEWS]%s has started robbing bank!",GetPlayerName(playerid,pName,sizeof(pName)));
SendClientMessage(playerid,COLOR_RED,string);
}
CMD:loot(playerid,params[])
{
new LootMax;
if(LootMax == 10) return SendClientMessage(playerid,COLOR_WHITE,"Enough robbery mate!");
if(!IsPlayerInRangeOfPoint(playerid,5,0.0,0.0,0.0)) return SendClientMessage(playerid,COLOR_RED,"You're not in the vault!");
if(BRobbery[playerid] != 1) return SendClientMessage(playerid,COLOR_WHITE,"The bank robbery isn't started yet!");
new money = random(1000);
format(string,sizeof(string),"Your loot bought up $%d in your bag!",money);
SendClientMessage(playerid,COLOR_YELLOW,string);
LootMax++;
return 1;
}