one question
#1

I've about 10-15 timers which just checking if player in a area to set just status that place
how better to use, just all checkers to use in a public or leave single timers for each area?
2 checkers
pawn Код:
forward CheckVehicleArea();
public CheckVehicleArea()
{
    for(new i=0; i<MAX_PLAYERS; i++ )
    {
        if(IsPlayerConnected(i) && IsPlayerInArea(i,2440.7849,2414.9807,-1409.5649,-1433.7346) && ShitInfo[i][pVehReg] == 0) // CHECK:if the player is in the area
        {
            new Float:x,Float:y,Float:z;
            GetPlayerPos(i,x,y,z);
            if(z <= 29.7)
            {
            SendClientMessage(i,COLOR_GREEN,"( ! ) Welcome to the Vehicle Registeration Area !");
            ShitInfo[i][pVehReg] = 1;
            }
            else if(ShitInfo[i][pVehReg] == 1)
            {
            SendClientMessage(i,COLOR_GREEN,"( ! ) You leave the Vehicle Registeration Area !");
            ShitInfo[i][pVehReg] = 0;
            }
        }
        else if(IsPlayerConnected(i) && !IsPlayerInArea(i,2440.7849,2414.9807,-1409.5649,-1433.7346) && ShitInfo[i][pVehReg] == 1)
        {
        SendClientMessage(i,COLOR_YELLOW,"( ! ) You leave the Vehicle Registeration Area !");
        ShitInfo[i][pVehReg] = 0;
        return 1;
        }
    }
    return 1;
}
forward CheckBank();
public CheckBank()
{
    for(new i=0; i<MAX_PLAYERS; i++ )
    {
        if(IsPlayerConnected(i) && IsPlayerInArea(i,1744.2325,1700.6185,-1637.5604,-1678.7394 ) && ShitInfo[i][pBank] == 0 && GetPlayerInterior(i) != 0) // CHECK:if the player is in the area
        {
            new Float:x,Float:y,Float:z;
            GetPlayerPos(i,x,y,z);
            if(z <= 34.4585)
            {
            scm(i,COLOR_RED,"( ! ) Fighting & Killing is Forbidden Here !");
            SendClientMessage(i,COLOR_GREEN,"( ! ) Welcome to the Bank !");
            ShitInfo[i][pBank] = 1;
            }
            else if(ShitInfo[i][pBank] == 1)
            {
            SendClientMessage(i,COLOR_GREEN,"( ! ) You leave the Bank !");
            ShitInfo[i][pBank] = 0;
            }
        }
        else if(IsPlayerConnected(i) && !IsPlayerInArea(i,1744.2325,1700.6185,-1637.5604,-1678.7394 ) && ShitInfo[i][pBank] == 1)
        {
        SendClientMessage(i,COLOR_YELLOW,"( ! ) You leave the Bank !");
        ShitInfo[i][pBank] = 0;
        return 1;
        }
    }
    return 1;
}
I just asking to know how to do less lag on server
Reply


Messages In This Thread
one question - by mineralo - 06.07.2012, 08:45
Re: one question - by Libra_PL - 06.07.2012, 09:02
Re: one question - by papedo - 06.07.2012, 09:11
Re: one question - by mineralo - 06.07.2012, 09:12

Forum Jump:


Users browsing this thread: 1 Guest(s)