25.07.2009, 23:24
This should work:
pawn Код:
if(strcmp(cmd, "/robstore", true) == 0)
{
for(new i=0; i < sizeof(Stores); i++)
{
if(PlayerToPoint(6.0, playerid, Stores[i][0], Stores[i][1], Stores[i][2]))
{
if(RobbedTime[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "You can only rob a store once after logging in!");
}
if(RobbedTime[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new robmoney = random(30000);
SendClientMessage(playerid, 0xFF0000FF, " You have robbed a store.");
RobbedTime[playerid] = 1;
format(string, sizeof(string), "** HQ: A store in Las Venturas has been robbed!!!!!. **", sendername);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
WantedPoints[playerid] =20; SetPlayerCriminal(playerid,255, "Robbing a store");
format(string,sizeof(string), "* %s shouts 'GET DOWN THE FLOOR' as he robs a store.", sendername);
SendClientMessage(playerid, COLOR_YELLOW, "You have been seen on the security cameras! Run away!");
ProxDetector(30.0, playerid, string, COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE,COLOR_DARKBLUE);
format(string, sizeof(string), "** You have successfully stolen $%d!",robmoney);
SendClientMessage(playerid,COLOR_YELLOW,string);
GivePlayerMoney(playerid, robmoney);
return 1;
}
}
}
SendClientMessage(playerid, COLOR_RED, "You have to be at a store.");
return 1;
}