errors plz help
#1

i want to make a bank time system i already make the timers and the script but it doesnt compile also i dunno if it gonna to work or not

Код:
#include <a_samp>
new timer1,timer2;
// ---------- Defines ---------- //

new Text:ServerTimeTXT;
new ServerTime = 12;
// ---------- Defines ---------- //


public OnFilterScriptInit()
{


    SetWorldTime(ServerTime);
    SetTimer("TimeCycle", 60000, true);
   	timer1 = SetTimer("isPlayerInArea",100, 1);
    timer2 = SetTimer("BankTime", 999, 1);
    ServerTimeTXT = TextDrawCreate(498.000000, 13.000000, "12:00");
	TextDrawBackgroundColor(ServerTimeTXT, 255);
	TextDrawFont(ServerTimeTXT, 1);
	TextDrawLetterSize(ServerTimeTXT, 0.440000, 1.100000);
	TextDrawColor(ServerTimeTXT, -1);
	TextDrawSetOutline(ServerTimeTXT, 1);
	TextDrawSetProportional(ServerTimeTXT, 1);
	return 1;
}

public OnFilterScriptExit()
{
    TextDrawDestroy(ServerTimeTXT); //Kustutab �ra textdrawi
	return 1;
}
stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
 	new Float:X,
	    Float:Y,
	    Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY)
	{
  	 	return 1;
    }
    return 0;
}

forward isPlayerInArea();
public isPlayerInArea()
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
        if(!IsPlayerInArea(i,2085.6704,2059.4272,11.0579,92.7368))
		{
			SendClientMessage(i, 0xFFFF00AA, "( ! ) Welcome to Bank!");
			return 1;
		}
  }
  return 1;
}

forward BankTime();
public BankTime()
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
	if(!IsPlayerInArea(i,2085.6704,2059.4272,11.0579,92.7368))
		{
		new hours;
		new minutes;
		GetPlayerTime(i, hours, minutes);
  	    if(hours == 6.00 && minutes == 0.00)
        {
			PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
			GivePlayerMoney(i, 7500);
			SendClientMessage(i, 0x12900BBF, "||| 6:00 | BANK TIME: |||");
			SendClientMessage(i, 0xFFFF00AA, "YOU RECEIVE +7.500 $");
			return 1;
			}
		}
  }
  return 1;
}
public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, 0xFFFF00AA, "( ! ) Welcome to Bank!");
    SetPlayerMapIcon( playerid,52,2085.6704,2059.4272,11.0579, 12,1,MAPICON_GLOBAL );
	return 1;
}



public OnPlayerSpawn(playerid)
{
	TextDrawShowForPlayer(playerid, ServerTimeTXT);
	return 1;
}

forward TimeCycle(playerid);
public TimeCycle(playerid)
{
	ServerTime++;
	SetWorldTime(ServerTime);

	new string[48];
    format(string, sizeof(string), "%d:00", ServerTime);
    TextDrawSetString(ServerTimeTXT,string);

    if(ServerTime == 23)//if servetime variable is at 23 it puts it the variable to 0
    {
    	ServerTime = 0;
    }
	return 1;
}
errors:C:\Users\Joe\Desktop\Untitled.pwn(16) : warning 204: symbol is assigned a value that is never used: "timer1"
C:\Users\Joe\Desktop\Untitled.pwn(17) : warning 204: symbol is assigned a value that is never used: "timer2"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#2

pawn Код:
public OnFilterScriptExit()
{
        TextDrawDestroy(ServerTimeTXT); //Kustutab �ra textdrawi
        KillTimer(timer1);
        KillTimer(timer2);
        return 1;
}
Reply
#3

thx mineralo rep+ but nw when i open te game i found the cilent message when the player in area repeated without stopping also i take the amount of money without stopping til it turns to 7 :00 so whats the reason
Reply
#4

You can use a variable when an player get in the area that will be = 1,
and when he will go it will return 0.
Then to check if the variable return 1 the message won't display.
Reply
#5

Doughty but i have tried this and it doesnt work i stay taking the money rapidly till it turns to 7:00 also i take it when iam not at the area and the maessage that i have to see when i enter the area "welcome to bank " rapidly
Reply
#6

pump
Reply
#7

pump
Reply
#8

no one
Reply
#9

no one ??
Reply
#10

Quote:

(funcname[], interval, repeating)

Notice the repeating.

Like your code
pawn Код:
SetTimer("isPlayerInArea",100, 1);
Look at the "1" at the end of it, that means it will repeat, if you made it 0, it won't repeat.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)