[Include] SpeedCap
#7

Why not do it like this there is no point of using CallLocalFunction() if someone is going to use their include then they will be using OnPlayerDriveFast() no matter what.

Код:
forward OnPlayerDriveFast(playerid, areaid);

public OnPlayerEnterDynamicArea(playerid, areaid)
{
     if(!INVALID_PLAYER_ID || !IsPlayerNPC(playerid))
     {
        new v_speed = sl_GetSpeed(playerid);

        for(new x = 0; x < MAX_SPEED_CAP;x++)
        {
	        if(areaid == SL_Speed[x][sl_areaid])
	        {
	           if(GetPlayerVehicleID(playerid) != 0)
	           {
	               if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	               {
	                   if(v_speed > SL_Speed[x][sl_speed])
	                   {
	                       	OnPlayerDriveFast(playerid, x);
							break;
	                   }
	               }
	           }
			}
		}
     }
     #if defined SL_OnPlayerEnterDyanmicArea
         SL_OnPlayerEnterDyanmicArea();
     #endif
     return 1;
}
Reply


Messages In This Thread
SpeedCap - by Whatname - 06.06.2017, 12:36
Re: SpeedCap - by NaS - 06.06.2017, 14:42
Re: SpeedCap - by coool - 06.06.2017, 17:13
Re: SpeedCap - by Whatname - 06.06.2017, 17:49
Re: SpeedCap - by Whatname - 06.06.2017, 17:51
Re: SpeedCap - by Whatname - 09.06.2017, 19:16
Re: SpeedCap - by Pottus - 09.06.2017, 21:21
Re: SpeedCap - by Whatname - 09.06.2017, 21:40
Re: SpeedCap - by Pottus - 10.06.2017, 02:34

Forum Jump:


Users browsing this thread: 1 Guest(s)