[Ajuda] FS NPC Bus LS
#1

Galera coloquei esse FS no meu servidor:


PHP код:
//Note
/*This is a [NPC]Filterscript  made by Adil.
  This Filter script allows you to travel through LS with two [NPC]'s who drive the Bus.
  I basically made this for RP servers.
  If you are facing some problems then read the tutorial or post your problem on the release page.
  Please you are requested to not to remove the credits, thankyou.
  For further support, this is my forums profile http://forum.sa-mp.com/member.php?u=3524...0.54268275
  Enjoy.*/
//Includes
#include <a_samp>
//Defines
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_RED 0xFF0000FF
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_TEAL 0x00AAAAAA
#define COLOR_OFFWHITE 0xF5DEB3AA
#define COLOR_DARKAQUA 0x83BFBFAA
//News
new Text3D:NPCTextBlue;
new 
Text3D:NPCTextBlack;
new 
NPCBlueBus;
new 
NPCBlackBus;
new 
BusID[MAX_PLAYERS];
new 
BusCost[MAX_PLAYERS];
new 
PlayerSitting[MAX_PLAYERS];
new 
Float:Playerx[MAX_PLAYERS], Float:Playery[MAX_PLAYERS], Float:Playerz[MAX_PLAYERS], Float:Playera[MAX_PLAYERS], PlayerSkin[MAX_PLAYERS];
new 
costtimer;
//Forwards
forward IsAtBlueBusStop(playerid);
forward IsAtBlackBusStop(playerid);
forward ResetView(playerid);
forward CPOff(playerid);
forward CostTimer(playerid);
forward ProxDetector(Float:radiplayeridstring[], color1color2color3color4color5);
//Publics
public OnFilterScriptInit()
{
    print(
"                                ");
    print(
"\n--------------------------------");
    print(
"  Adil's [NPC]LS Bus System.");
    print(
"--------------------------------\n");
    print(
"                                ");
    
    
//NPCs
    
ConnectNPC("BlueBusDriver","Bus");
    
ConnectNPC("BlackBusDriver","Bus2");
    
    
//3DTextLabels
    
NPCTextBlue Create3DTextLabel("Blue Bus"0x6495EDFF0.00.00.030.0,00);
    
NPCTextBlack Create3DTextLabel("Black Bus"0x6495EDFF0.00.00.030.0,00);
    
Create3DTextLabel("Press F to Exit"0x6495EDFF2021.9740,2235.6626,2103.953615.0,2);
    
Create3DTextLabel("Press F to Exit"0x6495EDFF2021.9740,2235.6626,2103.953615.0,3);
    
    
//Vehicles
    
NPCBlueBus CreateVehicle(4310.00.00.00.01251251);
    
NPCBlackBus CreateVehicle(4310.00.00.00.0001);
    
    
//Objects
    
CreateObject(12572868.9033203125, -1416.4062511.01317119598400179.99450683594);//Bus Stops
    
CreateObject(12572636.32421875, -1693.12510.95442008972200179.99450683594);
    
CreateObject(12572649.0073242188, -1710.604492187511.185441970825000);
    
CreateObject(12572243.845703125, -1725.91210937513.5960674285890090);
    
CreateObject(12572252.8876953125, -1738.8710937513.6260671615600270);
    
CreateObject(12571948.3310546875, -1454.352539062513.5960674285890090);
    
CreateObject(12571926.419921875, -1472.35937513.6260671615600270);
    
CreateObject(12571571.064453125, -2188.010742187513.626067161560090);
    
CreateObject(12571712.9423828125, -1818.7148437513.6260671615600270);
    
CreateObject(12571567.0966796875, -1725.475585937513.626067161560090);
    
CreateObject(12571544.9990234375, -1739.045898437513.6260671615600270);
    
CreateObject(12571503.9716796875, -1027.7617187523.7701282501220083.995971679688);
    
CreateObject(12571440.32421875, -1040.706054687523.90731620788600270);
    
CreateObject(12571188.8359375, -1354.627929687513.64830398559600179.99450683594);
    
CreateObject(12571212.8427734375, -1327.8398437513.647026062012000);
    
CreateObject(1257861.71252441406, -1313.300903320313.6260669708250090);
    
CreateObject(1257850.67578125, -1333.97070312513.61532974243200270);
    
CreateObject(1257393.69442749023, -1766.27026367195.61973476409910090);
    
CreateObject(12571705.58984375, -1805.8476562513.5300664901730090);//
    
CreateObject(26312022.02236.72102.90.00.090.0);//Bus Interior
    
CreateObject(26312022.02240.62102.90.00.090.0);
    
CreateObject(26312022.02244.52102.90.00.090.0);
    
CreateObject(26312022.02248.42102.90.00.090.0);
    
CreateObject(165012022.12238.32102.80.090.00.0);
    
CreateObject(165012022.12245.32102.80.090.00.0);
    
CreateObject(160002024.22240.12101.20.00.090.0);
    
CreateObject(160002019.82240.62101.20.00.0, -90.0);
    
CreateObject(160002022.22248.72101.20.00.0180.0);
    
CreateObject(165012021.82246.52107.30.0270.090.0);
    
CreateObject(165012022.02240.82107.30.0270.00.0);
    
CreateObject(165012022.02233.72107.30.0270.00.0);
    
CreateObject(180982024.32239.62104.80.00.090.0);
    
CreateObject(180982024.32239.72104.70.00.0450.0);
    
CreateObject(180982020.12239.62104.80.00.090.0);
    
CreateObject(180982020.02239.62104.70.00.090.0);
    
CreateObject(21802023.62236.12106.70.0180.090.0);
    
CreateObject(21802023.62238.12106.70.0180.090.0);
    
CreateObject(21802023.62240.12106.70.0180.090.0);
    
CreateObject(21802023.62242.12106.70.0180.090.0);
    
CreateObject(21802023.62244.12106.70.0180.090.0);
    
CreateObject(21802023.62246.12106.70.0180.090.0);
    
CreateObject(21802023.62248.12106.70.0180.090.0);
    
CreateObject(21802020.32235.12106.70.0180.0270.0);
    
CreateObject(21802020.32237.12106.70.0180.0270.0);
    
CreateObject(21802020.32239.12106.70.0180.0270.0);
    
CreateObject(21802020.32241.12106.70.0180.0270.0);
    
CreateObject(21802020.32243.12106.70.0180.0270.0);
    
CreateObject(21802020.32245.12106.70.0180.0270.0);
    
CreateObject(26742023.42238.32102.90.00.0600.0);
    
CreateObject(26742020.42242.32102.90.00.0600.0);
    
CreateObject(26742023.42246.32102.90.00.0600.0);
    
CreateObject(144052022.02242.12103.50.00.0540.0);
    
CreateObject(144052022.02243.62103.50.00.0180.0);
    
CreateObject(144052022.02245.12103.50.00.0180.0);
    
CreateObject(144052022.02246.62103.50.00.0180.0);
    
CreateObject(144052022.02248.12103.50.00.0180.0);
    
CreateObject(144052022.02249.62103.50.00.0180.0);
    
CreateObject(144052022.02251.12103.50.00.0180.0);
    
CreateObject(144052024.62242.12103.50.00.0180.0);
    
CreateObject(144052024.62243.62103.50.00.0180.0);
    
CreateObject(144052024.62245.12103.50.00.0180.0);
    
CreateObject(144052024.62246.62103.50.00.0180.0);
    
CreateObject(144052024.62248.12103.50.00.0180.0);
    
CreateObject(144052024.62249.62103.50.00.0180.0);
    
CreateObject(144052024.62251.12103.50.00.0180.0);
    
CreateObject(144052019.42242.12103.50.00.0180.0);
    
CreateObject(144052019.42243.62103.50.00.0180.0);
    
CreateObject(144052019.42245.12103.50.00.0180.0);
    
CreateObject(144052019.42246.62103.50.00.0180.0);
    
CreateObject(144052019.42248.12103.50.00.0180.0);
    
CreateObject(144052019.42249.62103.50.00.0180.0);
    
CreateObject(144052019.42251.12103.50.00.0180.0);
    
CreateObject(144052022.02253.62104.0, -6.00.0180.0);
    
CreateObject(144052021.12253.62104.0, -6.00.0180.0);
    
CreateObject(144052024.62253.62103.50.00.0180.0);
    
CreateObject(26742020.42235.72102.90.00.052.0);
    
CreateObject(26732020.42246.72102.90.00.0270.0);
    
CreateObject(27002023.52235.12105.5180.0, -4.090.0);
    
CreateObject(27002020.42235.12105.5180.00.090.0);
    
CreateObject(27002023.52242.12105.5180.0, -4.090.0);
    
CreateObject(27002020.42242.12105.5180.00.090.0);
    
CreateObject(17992023.12234.22105.7270.00.0360.0);
    
CreateObject(17992019.82234.22105.7270.00.00.0);
    
CreateObject(15382022.72234.72102.80.00.0180.0);
    
CreateObject(17992022.12234.22106.1720.090.0450.0);
    
CreateObject(17992021.82234.22105.10.0270.0270.0);
    
CreateObject(17992022.12234.22107.30.090.090.0);
    
CreateObject(17992021.62234.22106.30.0270.0270.0);
    
CreateObject(17992022.32234.22104.390.00.0180.0);//
    
return 1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
BusID[playerid] = 0;
    
BusCost[playerid] = 0;
    
PlayerSitting[playerid] = 0;
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    if(
IsPlayerNPC(playerid))
    {
        new 
npcname[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnpcnamesizeof(npcname));
        if(!
strcmp(npcname"BlueBusDriver"true))
        {
            
SetPlayerColor(playerid0xFFFFFF00);
        
PutPlayerInVehicle(playeridNPCBlueBus0);
            
SetPlayerSkin(playerid255);
            
ResetPlayerWeapons(playerid);
            
Attach3DTextLabelToVehicle(NPCTextBlueNPCBlueBus0.00.00.0);
        }
        if(!
strcmp(npcname"BlackBusDriver"true))
        {
            
SetPlayerColor(playerid0xFFFFFF00);
        
PutPlayerInVehicle(playeridNPCBlackBus0);
            
SetPlayerSkin(playerid255);
            
ResetPlayerWeapons(playerid);
            
Attach3DTextLabelToVehicle(NPCTextBlackNPCBlackBus0.00.00.0);
        }
        return 
1;
    }
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    if(
BusID[playerid])
    {
    
BusID[playerid] = 0;
    
BusCost[playerid] = 0;
        
PlayerSitting[playerid] = 0;
    
KillTimer(costtimer);
    
SetPlayerVirtualWorld(playerid0);
    }
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    new 
string[128];
    if(
Playerx[playerid] != 0)
    {
    return 
0;
    }
    if(
BusID[playerid] > 0)
    {
        for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
Playerx[i] != 0)
        {
                if(
BusID[playerid] == BusID[i])
        {
            
GetPlayerName(playeridstringsizeof(string));
                
format(stringsizeof(string), "%s says: %s"stringtext);
                    if(
IsPlayerInRangeOfPoint(playerid10/16Playerx[i], Playery[i], Playerz[i]))
                    {
                        
SendClientMessage(i0xE6E6E6E6string);
                    }
                    else if(
IsPlayerInRangeOfPoint(playerid10/8Playerx[i], Playery[i], Playerz[i]))
                {
                        
SendClientMessage(i0xC8C8C8C8string);
                    }
                    else if(
IsPlayerInRangeOfPoint(playerid10/4Playerx[i], Playery[i], Playerz[i]))
                {
                        
SendClientMessage(i0xAAAAAAAAstring);
                    }
                    else if(
IsPlayerInRangeOfPoint(playerid10/2Playerx[i], Playery[i], Playerz[i]))
            {
                        
SendClientMessage(i0x8C8C8C8Cstring);
                    }
                    else if(
IsPlayerInRangeOfPoint(playerid10Playerx[i], Playery[i], Playerz[i]))
            {
                        
SendClientMessage(i0x6E6E6E6Estring);
                    }
                return 
1;
                }
            }
        }
        
GetPlayerName(playeridstringsizeof(string));
    
format(stringsizeof(string), "%s says %s"stringtext);
    
ProxDetector(10playeridstring0xE6E6E6E60xC8C8C8C80xAAAAAAAA0x8C8C8C8C0x6E6E6E6E);
    return 
0;
    }
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/gotobluebus"cmdtexttrue) == 0)
    {
    if(!
IsPlayerAdmin(playerid))
    {
        
SendClientMessage(playeridCOLOR_RED"You are not authorised to use this command.");
        return 
1;
        }
    if(
BusID[playerid] > 0)
    {
        
SetPlayerVirtualWorld(playerid0);
    }
    
PutPlayerInVehicle(playeridNPCBlueBus2);
    
SendClientMessage(playeridCOLOR_DARKAQUA"You were teleported into the bus");
        return 
1;
    }
    if(
strcmp("/gotoblackbus"cmdtexttrue) == 0)
    {
        if(!
IsPlayerAdmin(playerid))
    {
        
SendClientMessage(playeridCOLOR_RED"You are not authorised to use this command.");
        return 
1;
    }
    if(
BusID[playerid] > 0)
    {
        
SetPlayerVirtualWorld(playerid0);
    }
    
PutPlayerInVehicle(playeridNPCBlackBus2);
    
SendClientMessage(playeridCOLOR_DARKAQUA"You were teleported into the bus");
        return 
1;
    }
    if(
strcmp("/lookout"cmdtexttrue) == 0)
    {
    if(!
IsPlayerInRangeOfPoint(playerid102021.9390,2241.9487,2103.9536))
    {
        
SendClientMessage(playeridCOLOR_RED"You are not inside a bus");
        return 
1;
    }
        
GetPlayerPos(playeridPlayerx[playerid], Playery[playerid], Playerz[playerid]);
    
GetPlayerFacingAngle(playeridPlayera[playerid]);
    
PlayerSkin[playerid] = GetPlayerSkin(playerid);
        
SetPlayerInterior(playerid0);
        
SetPlayerVirtualWorld(playerid0);
        
TogglePlayerSpectating(playerid1);
    if(
BusID[playerid] == 1)
    {
            
PlayerSpectateVehicle(playeridNPCBlueBus);
        }
        else
        {
            
PlayerSpectateVehicle(playeridNPCBlackBus);
        }
        
SetTimerEx("ResetView"20000"d"playerid);
    return 
1;
    }
    if(
strcmp("/sit"cmdtexttrue) == 0)
    {
        
ApplyAnimation(playerid,"PED","SEAT_idle",1.0,1,0,0,0,0);
        
PlayerSitting[playerid] = 1;
    return 
1;
    }
    if(
strcmp("/busroute"cmdtexttrue) == 0)
    {
    if(
IsAtBlueBusStop(playerid))
    {
        
SendClientMessage(playeridCOLOR_TEAL"Blue Bus Route: East Beach - The Stadium - The Gym - The County General Hospital - Los Santos International Airport - Taxi Stand");
        return 
1;
    }
    else if(
IsAtBlackBusStop(playerid))
    {
        
SendClientMessage(playeridCOLOR_TEAL"Black Bus Route: Taxi Stand - Police Department - The Bank - All Saints Hospital - Market Station - Santa Maria Beach");
        return 
1;
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"You are not at any bus stop");
    }
    return 
1;
    }
    if(
strcmp("/buslocation"cmdtexttrue) == 0)
    {
        new 
Float:busxFloat:busyFloat:busz;
    if(
IsAtBlueBusStop(playerid))
    {
        
GetVehiclePos(NPCBlueBusbusxbusybusz);
        
SetPlayerCheckpoint(playeridbusxbusybusz0);
        
GameTextForPlayer(playerid"~w~Locating ~r~Bus~w~. . . ."20003);
        
SetTimerEx("CPOff"30000"d"playerid);
        return 
1;
    }
    else if(
IsAtBlackBusStop(playerid))
    {
        
GetVehiclePos(NPCBlackBusbusxbusybusz);
               
SetPlayerCheckpoint(playeridbusxbusybusz0);
        
GameTextForPlayer(playerid"~w~Locating ~r~Bus~w~. . . ."20003);
        
SetTimerEx("CPOff"30000"d"playerid);
        return 
1;
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"You are not at any bus stop");
    }
    return 
1;
    }
    return 
0;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_PASSENGER)
    {
    if(
GetPlayerVehicleID(playerid) == NPCBlueBus)
    {
            
SetPlayerVirtualWorld(playerid2);
            
SetPlayerPos(playerid2021.9740,2235.6626,2103.9536);
            
SetPlayerFacingAngle(playerid355.3504);
            
SetCameraBehindPlayer(playerid);
        
SetPlayerInterior(playerid1);
        
BusID[playerid] = 1;
            
GameTextForPlayer(playerid"~w~Blue Bus"30001);
        
costtimer SetTimerEx("CostTimer"300001"d"playerid);
            
BusCost[playerid] += 20;
    }
    else if(
GetPlayerVehicleID(playerid) == NPCBlackBus)
    {
            
SetPlayerVirtualWorld(playerid3);
            
SetPlayerPos(playerid2021.9740,2235.6626,2103.9536);
            
SetPlayerFacingAngle(playerid355.3504);
            
SetCameraBehindPlayer(playerid);
            
SetPlayerInterior(playerid1);
        
BusID[playerid] = 2;
        
GameTextForPlayer(playerid"~w~Black Bus"30001);
            
costtimer SetTimerEx("CostTimer"300001"d"playerid);
        
BusCost[playerid] += 20;
    }
    }
    return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
string[128];
    if(
newkeys == KEY_SECONDARY_ATTACK)
    {
        if(
IsPlayerConnected(playerid))
    {
            if(
IsPlayerInRangeOfPoint(playerid12021.9740,2235.6626,2103.9536))
        {
                new 
Float:busxFloat:busyFloat:buszFloat:angle;
        if(
BusID[playerid] == 1)
        {
                    
GetVehiclePos(NPCBlueBusbusxbusybusz);
            
GetVehicleZAngle(NPCBlueBusangle);
        }
        else
        {
                    
GetVehiclePos(NPCBlackBusbusxbusybusz);
            
GetVehicleZAngle(NPCBlackBusangle);
        }
        
GetPlayerName(playeridstringsizeof(string));
                
format(stringsizeof(string), "%s opens the door and exits the bus."string);
            for(new 
i=0i<MAX_PLAYERSi++)
        {
            if(
BusID[i] == BusID[playerid])
            {
            
SendClientMessage(iCOLOR_PURPLEstring);
            }
        }
        
angle 360 angle;
        
busx floatsin(angle,degrees) * 1.5 floatcos(angle,degrees) * 1.5 busx;
                
busy floatcos(angle,degrees) * floatsin(angle,degrees) * busy;
                
busz busz;
                
SetPlayerVirtualWorld(playerid0);
        
SetPlayerInterior(playerid0);
                
SetPlayerPos(playeridbusxbusybusz);
        
BusID[playerid] = 0;
            
KillTimer(costtimer);
            
format(stringsizeof(string), "~r~-$%d"BusCost[playerid]);
        
GameTextForPlayer(playeridstring30001);
        
GivePlayerMoney(playerid, -BusCost[playerid]);
        
BusCost[playerid] = 0;
            }
    }
    }
    if(
newkeys == KEY_CROUCH)
    {
        if(
IsPlayerNPC(playerid))
    {
        new 
npcvehicle GetPlayerVehicleID(playerid);
        if(
npcvehicle == NPCBlueBus)
        {
        if(
IsPlayerInRangeOfPoint(playerid1002868.9033,-1416.4062,11.0131))
            {
                
format(stringsizeof(string), "[Bus Driver] The Bus has reached East Beach.");
            }
                else if(
IsPlayerInRangeOfPoint(playerid1002636.3242,-1693.125,10.9544))
            {
                
format(stringsizeof(string), "[Bus Driver] The Bus has reached The Stadium.");
            }
                else if(
IsPlayerInRangeOfPoint(playerid1002243.8457,-1725.9121,13.5960))
                {
            
format(stringsizeof(string), "[Bus Driver] The Bus has reached The Gym.");
        }
                else if(
IsPlayerInRangeOfPoint(playerid1001948.3310,-1454.3525,13.5960))
        {
                    
format(stringsizeof(string), "[Bus Driver] The Bus has reached The County General Hospital.");
            }
            else if(
IsPlayerInRangeOfPoint(playerid1001571.0644,-2188.0107,13.6260))
        {
                    
format(stringsizeof(string), "[Bus Driver] The Bus has reached Los Santos International Airport.");
            }
            else if(
IsPlayerInRangeOfPoint(playerid1001712.9423,-1818.7148,13.6260))
        {
                    
format(stringsizeof(string), "[Bus Driver] The Bus has reached The Taxi Stand.");
            }
            for(new 
0MAX_PLAYERSi++)
                {
            if(
IsPlayerInRangeOfPoint(i102021.9390,2241.9487,2103.9536) && BusID[i] == 1)
            {
                        
SendClientMessage(iCOLOR_OFFWHITEstring);
            
PlayerPlaySound(i11470.00.00.0);
            }
            }
        }
            else if(
npcvehicle == NPCBlackBus)
        {
                if(
IsPlayerInRangeOfPoint(playerid1001567.0966,-1725.4755,13.6260))
            {
                
format(stringsizeof(string), "[Bus Driver] The Bus has reached The Police Department.");
            }
                else if(
IsPlayerInRangeOfPoint(playerid1001503.9716,-1027.7617,23.7701))
            {
                
format(stringsizeof(string), "[Bus Driver] The Bus has reached The Bank.");
            }
                else if(
IsPlayerInRangeOfPoint(playerid1001188.8359,-1354.6279,13.6483))
                {
            
format(stringsizeof(string), "[Bus Driver] The Bus has reached All Saints Hospital.");
        }
                else if(
IsPlayerInRangeOfPoint(playerid100861.7125,-1313.3009,13.6260))
        {
                    
format(stringsizeof(string), "[Bus Driver] The Bus has reached Market Station.");
            }
                else if(
IsPlayerInRangeOfPoint(playerid100393.6944,-1766.2702,5.6197))
        {
                    
format(stringsizeof(string), "[Bus Driver] The Bus has reached Santa Maria Beach.");
            }
            else if(
IsPlayerInRangeOfPoint(playerid1001705.5898,-1805.8476,13.5300))
        {
                    
format(stringsizeof(string), "[Bus Driver] The Bus has reached The Taxi Stand.");
            }
            for(new 
0MAX_PLAYERSi++)
                {
            if(
IsPlayerInRangeOfPoint(i102021.9390,2241.9487,2103.9536) && BusID[i] == 2)
            {
                        
SendClientMessage(iCOLOR_OFFWHITEstring);
            
PlayerPlaySound(i11470.00.00.0);
            }
            }
        }
        }
    }
    if(
newkeys == KEY_FIRE)
    {
        if(
PlayerSitting[playerid] == 1)
    {
           
ClearAnimations(playerid1);
           
PlayerSitting[playerid] = 0;
        }
    }
    return 
1;
}
public 
IsAtBlueBusStop(playerid)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
IsPlayerInRangeOfPoint(playerid,2.0,2868.9033,-1416.4062,11.0131) || IsPlayerInRangeOfPoint(playerid,2.0,2636.3242,-1693.125,10.9544) || IsPlayerInRangeOfPoint(playerid,2.0,2649.0073,-1710.6044,11.1854)
           || 
IsPlayerInRangeOfPoint(playerid,2.0,2243.8457,-1725.9121,13.5960) || IsPlayerInRangeOfPoint(playerid,2.0,2252.8876,-1738.8710,13.6260) || IsPlayerInRangeOfPoint(playerid,2.0,1948.3310,-1454.3525,13.5960)
           || 
IsPlayerInRangeOfPoint(playerid,2.0,1926.4199,-1472.3593,13.6260) || IsPlayerInRangeOfPoint(playerid,2.0,1571.0644,-2188.0107,13.6260) || IsPlayerInRangeOfPoint(playerid,2.0,1712.9423,-1818.7148,13.6260))
        {
            return 
1;
        }
    }
    return 
0;
}
public 
IsAtBlackBusStop(playerid)
{
    if(
IsPlayerConnected(playerid))
    {
        if(
IsPlayerInRangeOfPoint(playerid,2.0,1567.0966,-1725.4755,13.6260) || IsPlayerInRangeOfPoint(playerid,2.0,1544.9990,-1739.0458,13.6260) || IsPlayerInRangeOfPoint(playerid,2.0,1503.9716,-1027.7617,23.7701)
           || 
IsPlayerInRangeOfPoint(playerid,2.0,1440.3242,-1040.7060,23.9073) || IsPlayerInRangeOfPoint(playerid,2.0,1188.8359,-1354.6279,13.6483) || IsPlayerInRangeOfPoint(playerid,2.0,1212.8427,-1327.8398,13.6470)
           || 
IsPlayerInRangeOfPoint(playerid,2.0,861.7125,-1313.3009,13.6260) || IsPlayerInRangeOfPoint(playerid,2.0,850.6757,-1333.9707,13.6153) || IsPlayerInRangeOfPoint(playerid,2.0,393.6944,-1766.2702,5.6197)
           || 
IsPlayerInRangeOfPoint(playerid,2.0,1705.5898,-1805.8476,13.5300))
    {
        return 
1;
    }
    }
    return 
0;
}
public 
ResetView(playerid)
{
    
TogglePlayerSpectating(playerid0);
    
SetPlayerInterior(playerid1);
    
SetPlayerPos(playeridPlayerx[playerid], Playery[playerid], Playerz[playerid]);
    
SetPlayerFacingAngle(playeridPlayera[playerid]);
    
SetPlayerSkin(playeridPlayerSkin[playerid]);
    
SetCameraBehindPlayer(playerid);
    if(
PlayerSitting[playerid] == 1)
    {
        
ApplyAnimation(playerid,"PED","SEAT_idle",30.0,1,0,0,0,0);
    }
    if(
BusID[playerid] == 1)
    {
        
SetPlayerVirtualWorld(playerid2);
    }
    else
    {
        
SetPlayerVirtualWorld(playerid3);
    }
    
Playerx[playerid] = 0;
}
public 
CPOff(playerid)
{
    
DisablePlayerCheckpoint(playerid);
}
public 
CostTimer(playerid)
{
    
BusCost[playerid] += 20;
}
public 
ProxDetector(Float:radiplayeridstring[], color1color2color3color4color5)
{
    if(
IsPlayerConnected(playerid))
    {
        new 
Float:playerposxFloat:playerposyFloat:playerposz;
    
GetPlayerPos(playeridplayerposxplayerposyplayerposz);
    for(new 
0MAX_PLAYERSi++)
    {
            if(
IsPlayerConnected(i))
            {
                if(
GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
        {
            if(
IsPlayerInRangeOfPoint(iradi/16playerposxplayerposyplayerposz))
            {
                        
SendClientMessage(icolor1string);
                    }
                    else if(
IsPlayerInRangeOfPoint(iradi/8playerposxplayerposyplayerposz))
            {
                        
SendClientMessage(icolor2string);
                    }
                    else if(
IsPlayerInRangeOfPoint(iradi/4playerposxplayerposyplayerposz))
            {
                        
SendClientMessage(icolor3string);
                    }
                    else if(
IsPlayerInRangeOfPoint(iradi/2playerposxplayerposyplayerposz))
                {
                        
SendClientMessage(icolor4string);
                    }
                    else if(
IsPlayerInRangeOfPoint(iradiplayerposxplayerposyplayerposz))
                {
                        
SendClientMessage(icolor5string);
                    }
                }
            }
            else
        {
            
SendClientMessage(icolor1string);
        }
        }
    }
    return 
1;




o Problema й que os onibus estгo bugados como mostra o print a seguir:

http://imgur.com/a/0MfJW





Alguйm pode me ajudar a resolver esse BUG? Grato!
Reply
#2

NPCBlueBus = CreateVehicle(431, 0.0, 0.0, 0.0, 0.0, 125, 125, 1);
NPCBlackBus = CreateVehicle(431, 0.0, 0.0, 0.0, 0.0, 0, 0, 1);

Й a posiзгo dos veiculos!
qualquer coisa entra em contato comigo.
skype: derickramon15
Reply
#3

O npc с estб spawnando.
Quote:

OnPlayerSpawn(playerid){
if (IsPlayerNPC(playerid)){
return 1;
}
}

Quote:

OnPlayerRequestClass(playerid, classid){
if(IsPlayerNPC(playerid)){
return 1;
}
}

Testa aн
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)