Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Will it makes a Lag ?

$
0
0
This is my code for a cnr server...

Will this makes any lag cuz my server's players are gettting timeout very fast and sometimes lagging also

PHP Code:

public OnPlayerUpdate(playerid)
{
    if(!
Player[playerid][onDuty])
        
updateWanted(playerid);
    
//-------- Sweeper Job ---------------------------------------------------//
    
if(SweeperJob[playerid] && GetVehicleModel(GetPlayerVehicleID(playerid)) == 574 && SweeperUpdate[playerid] < tickcount())
    {
        
SweeperUpdate[playerid] = tickcount()+UPDATE_TIME;
        
SweeperDistance[playerid] += floatround(GetPlayerDistanceFromPoint(playeridSweeperLastPos[playerid][0], SweeperLastPos[playerid][1], SweeperLastPos[playerid][2]));
        
GetPlayerPos(playeridSweeperLastPos[playerid][0], SweeperLastPos[playerid][1], SweeperLastPos[playerid][2]);

        new 
string[64];
        
format(stringsizeof(string), "~b~~h~Sweeper Job~n~~n~~w~Cleaned: ~y~%d Meters"SweeperDistance[playerid]);
        
PlayerTextDrawSetString(playeridSweeperText[playerid], string);
    }
    
//-------------------------------------------------------------------------------//
    
if(Player[playerid][onDerby])
    {
        new 
Float:xFloat:yFloat:zmsg[256];
        
format(msgsizeof(msg), "[Derby]: %s has fallen from the map."GetName(playerid));
        
GetPlayerPos(playeridxyz);
        if(
< -1.00)
        {
            foreach(new 
Player)
            {
                if(
Player[i][onDerby])
                    
//Info(i, msg);
                    
SendClientMessage(i,COLOR_ORANGE,msg);
            }
            
loadData(playerid);
            
Player[playerid][onDerby] = false;
        }
    }
    
    if(
Player[playerid][onFallout])
    {
        new 
Float:xFloat:yFloat:zmsg[512];
        
format(msgsizeof(msg), "[Fallout]: %s has dropped out of Fallout event."GetName(playerid));
        
GetPlayerPos(playeridxyz);
        if(
2.00)
        {
            foreach(new 
Player)
            {
                if(
Player[i][onFallout])
                    
//Info(i, msg);
                    
SendClientMessage(i,COLOR_ORANGE,msg);
            }
            
loadData(playerid);
            
SetCameraBehindPlayer(playerid);
            
Player[playerid][onFallout] = false;
        }
    }
    if(
GetPVarInt(playerid,"YEAH") == 1)
    {
        new
            
Float:VPos[3],
            
Float:Rotation
        
;

         
GetVehiclePos(GetPlayerVehicleID(playerid), VPos[0], VPos[1], VPos[2]);
         
Rotation PointAngle(playeridVPos[0], VPos[1], GetPVarFloat(playerid"Spongebob"), GetPVarFloat(playerid"Mario"));
        if(!
Player[playerid][truckingMission])
            
AttachObjectToVehicle(GPSObject[playerid], GetPlayerVehicleID(playerid), 0.00.01.50.090.0Rotation);
        else
            
AttachObjectToVehicle(GPSObject[playerid], GetPlayerVehicleID(playerid), 0.00.03.50.090.0Rotation);
    }
    return 
1;



Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>