warn problem
#1

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;
	}
/*------------------------------------------------------------------------------*/
Reply
#2

make a variable for example
pawn Код:
new InBank[MAX_PLAYERS];
under all includes...

and if you tele the player into the bankset the variable to 1
pawn Код:
InBank[playerid] =1;
now you need to check if the player is in the bank
pawn Код:
if(InBank[playerid] == 1)
Reply
#3

and how to make sys send msg?
Reply
#4

https://sampwiki.blast.hk/wiki/SendClientMessage
Reply
#5

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 : ^.^
Reply
#6

I'm not so good in pawno but how will system know when I am inside a bank?
Reply
#7

Do you have it set up with a checkpoint or an interior
Reply
#8

interior
Reply
#9

someone help?
Reply
#10

Maybe Put a checkpoint Outside the bank Then when Player Enters it
Set The Bank variable to 1? And Set The Player pos etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)