+rep for any help!
#1

Hey!
I was making bank time system like if the time is 13 and player in bank it gives the player money and sends client message to him!
i made it with public and forwarded the callback it compiles without any error but when i try it , it dont give me money or send client message!
Code:
Код:
forward OnPlayerInBank(playerid);
public OnPlayerInBank(playerid)
{
	new hour, minutes;
	GetPlayerTime(playerid, hour, minutes);
	if(inbank[playerid] == 1)
	{
  		if(hour == 13 && minutes == 00)
		{
	     	SendClientMessage(playerid, COLOR_WHITE, "The bank paid you 15 DCash!");
	     	GivePlayerMoney(playerid, 15);
		}
	}
	return 1;
}
Please help me!
I will +rep for any help!
Thanks!
Ironmen
Reply
#2

if(inbank[playerid] == 1) . That mean from 13:00 to 13:01 the player need to be in the bank. Unless he will not get that
Reply
#3

PHP код:
forward OnPlayerInBank(playerid);
public 
OnPlayerInBank(playerid)
{
    new 
hourminutes;
    
GetPlayerTime(playeridhourminutes);
    if(
inbank[playerid] == 1)
    {
          if(
hour == 13 && minutes == 00)
        {
                   foreach(new 
i:Player)
                    {
                    
SendClientMessage(iCOLOR_WHITE"The bank paid you 15 DCash!");
                    
GivePlayerMoney(i15);
                    }
        }
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
PHP код:
forward OnPlayerInBank(playerid);
public 
OnPlayerInBank(playerid)
{
    new 
hourminutes;
    
GetPlayerTime(playeridhourminutes);
    if(
inbank[playerid] == 1)
    {
          if(
hour == 13 && minutes == 00)
        {
                   foreach(new 
i:Player)
                    {
                    
SendClientMessage(iCOLOR_WHITE"The bank paid you 15 DCash!");
                    
GivePlayerMoney(i15);
                    }
        }
    }
    return 
1;

Thanks but didn't work!
----------------------------------------------------------------------
SoFahim
if(inbank[playerid] == 1) means that player entered the bank with /enter
look!
Код:
CMD:enter(playerid, params[])
{
	if(IsPlayerInRangeOfPoint(playerid, 2, 1414.1307,-1487.2390,20.4345))//bank
	{
		SetPlayerPos(playerid, 344.6933,178.1691,1014.1875);
		SetPlayerInterior(playerid, 3);
		inbank[playerid] = 1;
 	}
	return 1;
}
Reply
#5

You're having minutes == 0, that means if the payer's not in the bank at the exact time, he won't getting anything.
Reply
#6

i wait at the bank from 12:30
What to do?!?!
Please help!
Reply
#7

How do you call OnPlayerInBank? It seems you need a timer so it can check every second.
Reply
#8

krokett how to check it every second?
Reply
#9

inbank[playerid] == 1
check this is it equal to 1 when you are in bank and also check have you called your function ?

Quote:
Originally Posted by ironmen
Посмотреть сообщение
krokett how to check it every second?
Just use settimer("function_name",duration in ms,true); to check it for every second
Reply
#10

If you didnt make a timer you need to enter the bank at that exact time :P
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)