(FS) jLights

Готовые решения скриптов, filterScript

Moderator: SJplayer

Avatar
Topic author
Aleksandr M
Модератор
Модератор
Posts: 55
With us: 7 years 3 months

(FS) jLights

Post #1by Aleksandr » 28 Jul 2013, 11:22

(FS) jLights
Автор: Johurt(ES.^, Эдгар)

Команда для включения/выключения мерцающих фар: /lights

phpBB [media]


Код

Code: Select all

/*
        jLights by Johurt(ES.^, Edgar).
        Date: 2013-07-18
        Video: http://www.youtube.com/watch?v=mM2epAmab8c
*/
#include <a_samp>
new pLights[MAX_PLAYERS], bool:LightsOnOff[MAX_PLAYERS];

public 
OnGameModeInit()
{
    
SetTimer("Timer"300true);
    return 
1;
}

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp("/lights"cmdtexttrue7))
    {
        if(!
LightsOnOff[playerid])
        {
            
LightsOnOff[playerid] = true;
        }
        else
        {
            
LightsOnOff[playerid] = false;
            new 
vehicleid GetPlayerVehicleID(playerid), panelsdoorslightstires;
            if(
vehicleid != && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
                
UpdateVehicleDamageStatus(vehicleidpanelsdoors0tires);
            }
        }
        return 
1;
    }
    return 
0;
}

public 
OnPlayerExitVehicle(playeridvehicleid)
{
    new 
panelsdoorslightstires;
    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
    
UpdateVehicleDamageStatus(vehicleidpanelsdoors0tires);
    return 
1;
}

forward Timer();
public 
Timer()
{
    new 
pvehicleidpanelsdoorslightstires;
    for(
0MAX_PLAYERSp++)
    {
        if(!
IsPlayerConnected(p) || IsPlayerNPC(p)) continue;
        {
            
vehicleid GetPlayerVehicleID(p);
            if(
vehicleid != && GetPlayerState(p) == PLAYER_STATE_DRIVER)
            {
                if(
LightsOnOff[p])
                {
                    if(
pLights[p] != && pLights[p] != 4)
                    {
                        
pLights[p] = 1;
                    }
                    else
                    {
                        if(
pLights[p] == 1)
                        {
                            
pLights[p] = 4;
                        }
                        else
                        {
                            
pLights[p] = 1;
                        }
                    }
                    
GetVehicleDamageStatus(vehicleidpanelsdoorslightstires);
                    
UpdateVehicleDamageStatus(vehicleidpanelsdoorspLights[p], tires);
                }
            }
        }
    }
    return 
1;

! ! !


Return to “Скрипты / FS”

Who is online

Users browsing this forum: 1 guest