Robbank command -
ivanorezac - 25.03.2010
Hi , i would like to make the command for robbing bank ..
How would it work :
Players go to bank at this point : 2315.2446,-1.0065,26.7422
There they type /robbank , and if wanted level is > than 5 , it says You have too big wanted lvl to robbank ! And if it is lower , it sets their wanted lvl to 10 and sands PD/FBI message "Someone is robbing the bank !"
Now they need to go somewhere to put money ( it makes them checkpoint at the map)
When they are there , they get random money from 1000-100000
To lose Wanted Level , they need to go somewhere else ...
I'm using GTA:RP script and here is something , i have started , but i don't know how to finish , i have just edited /givemoney admin command :
//----------------------------------[Robbank]------------------------------------------------
if(strcmp(cmd, "/robbank", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /robbank");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pWantedDeaths] <= 5)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
//ConsumingMoney[playa] = 1;
SafeGivePlayerMoney(playa, money);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "[ADMIN] %s has admin-given %s $%d.", sendername,giveplayer,money);
ABroadCast(COLOR_YELLOW,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You Have to big wanted level to rob the bank!");
}
}
return 1;
}
//----------------------------------[Robbank]------------------------------------------------
who knows ,please help
Re: Robbank command -
Zimon95 - 25.03.2010
pawn Код:
if(strcmp(cmd, "/robbank", true) == 0)
{
new money;
money = random(100000);
if(PlayerInfo[playerid][pWantedDeaths] >= 5) return SendClientMessage(playerid, COLOR_GRAD1, " You Have to big wanted level to rob the bank!");
if(IsPlayerInRangeOfPoint(playerid,2315.2446,-1.0065,26.7422,10.0)
{
SafeGivePlayerMoney(playerid, money);
//Other stuff...
}
else return SendClientMessage(playerid,COLOR_GRAD1,"You are not at the bank!");
return 1;
}
Re: Robbank command -
ivanorezac - 25.03.2010
You forgot ")" , but thank you anyway , but still , i have one problem , it wont work even if I'm at the bank , what should i do ?
Quote:
Originally Posted by Zimon95
pawn Код:
if(strcmp(cmd, "/robbank", true) == 0) { new money; money = random(100000); if(PlayerInfo[playerid][pWantedDeaths] >= 5) return SendClientMessage(playerid, COLOR_GRAD1, " You Have to big wanted level to rob the bank!"); if(IsPlayerInRangeOfPoint(playerid,2315.2446,-1.0065,26.7422,10.0)) { SafeGivePlayerMoney(playerid, money); //Other stuff... } else return SendClientMessage(playerid,COLOR_GRAD1,"You are not at the bank!"); return 1; }
|
Re: Robbank command -
Thrarod - 31.03.2010
Код:
if(strcmp(cmd, "/robbank", true) == 0)
{
new money;
money = random(100000);
if(PlayerInfo[playerid][pWantedDeaths] >= 5)
{
SendClientMessage(playerid, COLOR_GRAD1, "You Have to big wanted level to rob the bank!");
}
if(IsPlayerInRangeOfPoint(playerid,2315.2446,-1.0065,26.7422,10.0) == 1)
{
GivePlayerMoney(playerid, money); //Not SafeGivePlayerMoney
SetPlayerWantedLevel(playerid, 5) //You can change 5
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"You are not at the bank!");
}
return 1;
}
Should work I think