warn problem - 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: warn problem (
/showthread.php?tid=247288)
warn problem -
Gangasta300 - 08.04.2011
hi all
can someone help me to make that when I type /withdraw command outside range of bank system says to me : "You are not in the bank".
help please
here is my withdraw script:
Код:
/*------------------------------------------------------------------------------*/
if(strcmp(cmd, "/withdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
}
if(IsPlayerInRangeOfPoint(playerid, 6.0, 330.8681,129.4855,1007.9657))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /withdraw [Kolicina]");
format(string, sizeof(string), " Imate $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new cashdeposit = strvalEx(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, CRVENA, "Komanda: /withdraw [Kolicina]");
format(string, sizeof(string), " Imate $%d na racunu.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "Nemate toliko !");
return 1;
}
ConsumingMoney[playerid] = 1;
JB_GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), "Podigli ste $%d sa racuna, Preostalo: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, ZUTA, string);
return 1;
}
return 1;
}
/*------------------------------------------------------------------------------*/
AW: warn problem -
xerox8521 - 08.04.2011
make a variable for example
under all includes...
and if you tele the player into the bankset the variable to 1
now you need to check if the player is in the bank
pawn Код:
if(InBank[playerid] == 1)
Re: warn problem -
Gangasta300 - 08.04.2011
and how to make sys send msg?
AW: warn problem -
xerox8521 - 08.04.2011
https://sampwiki.blast.hk/wiki/SendClientMessage
Re: warn problem -
Kitten - 08.04.2011
pawn Код:
if(InBank[playerid] == 1) {
SendClientMessage(playerid,color,"ERROR: You are already at bank " ) ;
}
else if(INBank[playerid] == 0 ) {
// do what ever you want
}
EDIT : ^.^
Re: warn problem -
Gangasta300 - 08.04.2011
I'm not so good in pawno but how will system know when I am inside a bank?
Re: warn problem -
PCheriyan007 - 08.04.2011
Do you have it set up with a checkpoint or an interior
Re: warn problem -
Gangasta300 - 08.04.2011
interior
Re: warn problem -
Gangasta300 - 08.04.2011
someone help?
Re: warn problem -
[OC]Zero - 08.04.2011
Maybe Put a checkpoint Outside the bank Then when Player Enters it
Set The Bank variable to 1? And Set The Player pos etc.