13.08.2012, 14:25
Hello can someone help me with /robbank command for RP server ?
Thanks is Advance !
Thanks is Advance !
|
Guiding is better than spamming shit
I won't make the entire command for you, but I'll give you some tips: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint If the player is near the point where to /robbank https://sampwiki.blast.hk/wiki/SetTimer A timer to see if the player is still in range and another one to give the money. |
new timesrobbed[MAX_PLAYERS];
timesrobbed[playerid] = 0;
if(strcmp(cmd, "/rob", true) == 0)
{
if(PlayerToPoint(3, playerid,// add Coordes here where players can rob this place))
{
if(timesrobbed[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "You cannot rob the Bank more then once per day!");
}
if(timesrobbed[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new robmoney = random(4000);
ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 0, 0); // Rob
SendClientMessage(playerid, 0xFF0000FF, " ");
timesrobbed[playerid]+=1;
format(string, sizeof(string), "** HQ: The 24/7 in Los Santos has been robbed!. **", sendername);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
WantedPoints[playerid]+=3; SetPlayerCriminal(playerid,255, "Robbing the 24/7!");
SendClientMessage(playerid, COLOR_YELLOW, "You have been seen on the security cameras! Run away!");
format(string,sizeof(string), "* %s points his gun at the clerk and attempts to rob the 24/7.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "** You have successfully stolen $%d!",500);
SendClientMessage(playerid,COLOR_YELLOW,string);
SafeGivePlayerMoney(playerid, 500);
}
}
return 1;
}
|
Код:
new timesrobbed[MAX_PLAYERS]; Код:
timesrobbed[playerid] = 0; Код:
if(strcmp(cmd, "/rob", true) == 0)
{
if(PlayerToPoint(3, playerid,// add Coordes here where players can rob this place))
{
if(timesrobbed[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "You cannot rob the Bank more then once per day!");
}
if(timesrobbed[playerid] == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new robmoney = random(4000);
ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 0, 0); // Rob
SendClientMessage(playerid, 0xFF0000FF, " ");
timesrobbed[playerid]+=1;
format(string, sizeof(string), "** HQ: The 24/7 in Los Santos has been robbed!. **", sendername);
SendRadioMessage(1, TEAM_BLUE_COLOR, string);
WantedPoints[playerid]+=3; SetPlayerCriminal(playerid,255, "Robbing the 24/7!");
SendClientMessage(playerid, COLOR_YELLOW, "You have been seen on the security cameras! Run away!");
format(string,sizeof(string), "* %s points his gun at the clerk and attempts to rob the 24/7.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "** You have successfully stolen $%d!",500);
SendClientMessage(playerid,COLOR_YELLOW,string);
SafeGivePlayerMoney(playerid, 500);
}
}
return 1;
}
REP+ If i helps you '*' |
!