SA-MP Forums Archive
[Ajuda]Ajudinha aqui no neon Porfavor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda]Ajudinha aqui no neon Porfavor (/showthread.php?tid=264295)



[Ajuda]Ajudinha aqui no neon Porfavor - [Dk]TuReTOo - 25.06.2011

Boas, eu vou ja esplicar tudo para que nao haja nenhum erro


eu tenho o meu sistema de consessionario, os carros que estao a venda sao por bloco de notas chamado "Cars.cfg"

tipo os carros de venda sao desde id 184 ate 268

eu comprei o carro ID 200

como eu coloco no meu gm o carro id 200 com neon? ja mandei 2 topicos mas eles dizem me que й por Addstaticvehicle

mas nao й porque o carro ja esta criado so quero adecionar o neon


vejam axo que tem que ser assim

PHP код:
if (vehicleid == 200//aqui e o id do carro que vai ter o neon.
    
{
        
//que funзao de neon meto aqui?
    




Re: [Ajuda]Ajudinha aqui no neon Porfavor - mengueh - 25.06.2011

https://sampwiki.blast.hk/wiki/AttachObjectToVehicle


Re: [Ajuda]Ajudinha aqui no neon Porfavor - [Dk]TuReTOo - 25.06.2011

Tive a ver isso e coluquei assim porque nao funciona ?

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
if (
vehicleid == 44)
    {
        
AttachObjectToVehicle(1864844, -0.80.0, -0.700.00.00.0);
        
AttachObjectToVehicle(18648440.80.0, -0.700.00.00.0);
    } 
nao da erros nem nada mas nao aparece :S


Re: [Ajuda]Ajudinha aqui no neon Porfavor - [Dk]TuReTOo - 25.06.2011

Tive a ver isso e coluquei assim porque nao funciona ?

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
if (
vehicleid == 44)
    {
        
AttachObjectToVehicle(1864844, -0.80.0, -0.700.00.00.0);
        
AttachObjectToVehicle(18648440.80.0, -0.700.00.00.0);
    } 
nao da erros nem nada mas nao aparece :S


Re: [Ajuda]Ajudinha aqui no neon Porfavor - rjjj - 25.06.2011

Quote:
Originally Posted by [Dk]TuReTOo
Посмотреть сообщение
Tive a ver isso e coluquei assim porque nao funciona ?

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
if (
vehicleid == 44)
    {
        
AttachObjectToVehicle(1864844, -0.80.0, -0.700.00.00.0);
        
AttachObjectToVehicle(18648440.80.0, -0.700.00.00.0);
    } 
nao da erros nem nada mas nao aparece :S

Bem, certifique-se de que o veнculo no qual vocк tentou entrar й realmente o de ID 44, atravйs deste comando :



pawn Код:
//Coloque na public OnPlayerCommandText:

if(!strcmp("/teste",cmdtext,true,6))
    {
        new texto[50];
        format(texto,50,"ID do Veнculo que estб com vocк dentro = %i",GetPlayerVehicleID(playerid));
        SendClientMessage(playerid,0xFFFFFFAA,texto);
        return true;
    }


Se realmente for, provavelmente o problema se resulta da diferenзa entre a velocidade da callback (ao ser chamada) e a velocidade da fixaзгo do objeto no veнculo .


Nesse caso, ao invйs de utilizar o OnPlayerEnterVehicle, use:



pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    #define vehicleid GetPlayerVehicleID(playerid)
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if (vehicleid == 44)
        {
            AttachObjectToVehicle(18648, 44, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
            AttachObjectToVehicle(18648, 44, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
        }
    }
    return 1;
}


Espero ter ajudado .


Re: [Ajuda]Ajudinha aqui no neon Porfavor - [Dk]TuReTOo - 25.06.2011

nao sei onde colucar este codigo dame semrpe 26 erros :S

ta aki a public ode coloco ?

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new 
string[256];
    new 
pveh GetVehicleModel(GetPlayerVehicleID(playerid));
    new 
vehicle GetPlayerVehicleID(playerid);
    if(
newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        
SetTimerEx("Startup"1false"ii"playeridvehicle);
        
SetTimerEx("engine2"2500false"ii"playerid);
    }
    else if(
newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        
SetTimerEx("Startup"1false"ii"playeridvehicle);
        
SetTimerEx("engine2"2500false"ii"playerid);
    }
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        if(
PlayerKarting[playerid] > && PlayerInKart[playerid] > 0)
        {
            
PlayerInKart[playerid] = 0;
            
KartingPlayers --;
        }
        if(
TransportDuty[playerid] > 0)
        {
            if(
TransportDuty[playerid] == 1)
            {
                
TaxiDrivers -= 1;
            }
            else if(
TransportDuty[playerid] == 2)
            {
                
BusDrivers -= 1;
            }
            
TransportDuty[playerid] = 0;
            
format(stringsizeof(string), "* Vocк estб agora fora de serviзo $%d *"TransportMoney[playerid]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
SafeGivePlayerMoney(playeridTransportMoney[playerid]);
            
/*ConsumingMoney[playerid] = 1;*/ TransportValue[playerid] = 0TransportMoney[playerid] = 0;
        }
        if(
TransportCost[playerid] > && TransportDriver[playerid] < 999)
        {
            if(
IsPlayerConnected(TransportDriver[playerid]))
            {
                
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
                
TransportTime[TransportDriver[playerid]] = 0;
                
TransportCost[TransportDriver[playerid]] = 0;
                
format(stringsizeof(string), "~w~O custo de viagem~n~~r~$%d",TransportCost[playerid]);
                
GameTextForPlayer(playeridstring50001);
                
format(stringsizeof(string), "~w~Passageiro saiu do tбxi~n~~g~Ganhaste: $%d",TransportCost[playerid]);
                
GameTextForPlayer(TransportDriver[playerid], string50001);
                
SafeGivePlayerMoney(playerid, -TransportCost[playerid]);
                
TransportCost[playerid] = 0;
                
TransportTime[playerid] = 0;
                
TransportDriver[playerid] = 999;
            }
        }
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
    }
    if(
newstate == PLAYER_STATE_PASSENGER// TAXI & BUSSES
    
{
        new 
name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        new 
vehicleid GetPlayerVehicleID(playerid);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
IsPlayerInVehicle(ivehicleid) && GetPlayerState(i) == && TransportDuty[i] > 0)
                {
                    if(
GetPlayerMoney(playerid) < TransportValue[i])
                    {
                        
format(stringsizeof(string), "* Vocк precisa $%d para entrar."TransportValue[i]);
                        
SendClientMessage(playeridCOLOR_REDstring);
                        
RemovePlayerFromVehicle(playerid);
                    }
                    else
                    {
                        if(
TransportDuty[i] == 1)
                        {
                            
format(stringsizeof(string), "* Vocк pagou $%d ao taxista."TransportValue[i]);
                            
SendClientMessage(playeridCOLOR_REDstring);
                            
format(stringsizeof(string), "* Passageiro %s entrou no seu taxi."name);
                            
SendClientMessage(iCOLOR_GREENstring);
                            
TransportTime[i] = 1;
                            
TransportTime[playerid] = 1;
                            
TransportCost[playerid] = TransportValue[i];
                            
TransportCost[i] = TransportValue[i];
                            
TransportDriver[playerid] = i;
                        }
                        else if(
TransportDuty[i] == 2)
                        {
                            
format(stringsizeof(string), "* Vocк pagou $%d ao camionista ."TransportValue[i]);
                            
SendClientMessage(playeridCOLOR_REDstring);
                            
format(stringsizeof(string), "* Passageiro %s entrou no seu autocarro."name);
                            
SendClientMessage(iCOLOR_GREENstring);
                        }
                        
SafeGivePlayerMoney(playerid, - TransportValue[i]);
                        
TransportMoney[i] += TransportValue[i];
                    }
                }
            }
        }
    }
    if(
newstate == PLAYER_STATE_WASTED)
    {
        if(
WantedLevel[playerid] >= 1)
        {
            new 
price WantedLevel[playerid] * 1000;
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
gTeam[i] == && CrimInRange(30.0playerid,i))
                    {
                        
count 1;
                        
format(stringsizeof(string), "~w~execuзгo suspeito~r~Assassinado~n~Bфnus~g~$%d"price);
                        
GameTextForPlayer(istring50001);
                        
//ConsumingMoney[i] = 1;
                        
SafeGivePlayerMoney(iprice 2);
                        
PlayerPlaySound(i10580.00.00.0);
                    }
                }
            }
            if(
count == 1)
            {
                
SafeGivePlayerMoney(playerid, - price);
                
PlayerInfo[playerid][pWantedDeaths] += 1;
                
PlayerInfo[playerid][pJailed] = 1;
                
PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
                
format(stringsizeof(string), "* Foste para a prisгo porque cometeste um crime"PlayerInfo[playerid][pJailTime], price);
                
SendClientMessage(playeridCOLOR_REDstring);
                
WantedPoints[playerid] = 0;
                
WantedLevel[playerid] = 0;
            }
        }
    }

    if(
newstate == PLAYER_STATE_DRIVER)
    {
// 38 / 49 / 56 = SS
        
new newcar GetPlayerVehicleID(playerid);
        new 
oldcar gLastCar[playerid];
        new 
housecar PlayerInfo[playerid][pPhousekey]+1;
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        if(
IsABoat(newcar))
  {
            if(
PlayerInfo[playerid][pBoatLic] < 1)
            {
                
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem licenca de vela, diriga com cuidado ou a policia vai notar.");
                
TogglePlayerControllable(playerid1);
            }
        }
        else if(
IsAPlane(newcar))
        {
            if(
PlayerInfo[playerid][pFlyLic] < 1)
            {
                if(
TakingLesson[playerid] == 1) { }
                else {
                
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem licenca de voф, diriga com cuidado ou a policia vai notar.");
                
TogglePlayerControllable(playerid1); }
            }
        }
        else
        {
            if(
PlayerInfo[playerid][pCarLic] < 0)
            {
                if(
PlayerDrunk[playerid] >= 5)
                {
                    
WantedPoints[playerid] += 1;
                    
SetPlayerCriminal(playerid,255"Dirigir embriagado");
                }

            }
            else if(
PlayerDrunk[playerid] >= 5)
            {
                
WantedPoints[playerid] += 1;
                
SetPlayerCriminal(playerid,255"dirigir embriagado");
            }

            if(
PlayerInfo[playerid][pCarLic] < 1)
            {
                if(
IsABike(newcar) || IsAOBike(newcar)) { }
                else
                {
                    
/*if(PlayerInfo[playerid][pCarLic] < 1)
                    {
                        WantedPoints[playerid] += 1;
                        SetPlayerCriminal(playerid,255, "Driving without License");
                    }*/
                    
if(TakingLesson[playerid] == 1) { }
                    else {
                    
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem carta ainda, dirige com cuidado ou a polнcia vai notar");
                  }
                }
            }
        }
//Done with car check
        
if(IsACopCar(newcar))
        {
            if(
IsACop(playerid)) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        if(
IsATank(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pLeader] == 3) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        if(
IsAnFbiCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsNgCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsAGovernmentCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 7||PlayerInfo[playerid][pMember] == 7) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsAHspdCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == && PlayerInfo[playerid][pRank] > 2) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        else if(
IsAnAmbulance(newcar))
        {
            if(
PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        
/*if(IsAGangCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 5||PlayerInfo[playerid][pMember] == 5) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar2(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar3(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 14||PlayerInfo[playerid][pMember] == 14) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar4(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 15) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar5(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 16) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }*/
        
if(IsAPizzabike(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 17) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves desta moto.");}
        }
        if(
IsABus(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 14)
            {
                
GameTextForPlayer(playerid"~w~Usa /comecaraleste ou /comecaraoeste para comecar a sua rota de autocarro"50003);
                
SendClientMessage(playeridCOLOR_GREEN"Vocк jб entrou num autocarro, usa /sair para cancelar a seleзгo de rota.");
                
//GangZoneShowForPlayer(playerid, buszonewest, COLOR_RED);
                //GangZoneShowForPlayer(playerid, buszoneeast, COLOR_BLUE);
                
SendClientMessage(playeridCOLOR_GREEN"Para comeзar a fazer a rota oeste, usa /comecaraoeste. Para comeзar a fazer a rota leste, usa /comecaraleste.");
                new 
routezonecheck IsInBusrouteZone(playerid);
                if (
routezonecheck == 0SendClientMessage(playeridCOLOR_GREEN"Nota: O prуximo caminho й o leste.");
                else if (
routezonecheck == 1SendClientMessage(playeridCOLOR_GREEN"Nota: O caminho mais prуximo fica a oeste.");
                
TogglePlayerControllable(playerid0);
            }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do autocarro.");}
        }
        if(
IsATowcar(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 7) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsATruck(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 16)
            {
                
format(stringsizeof(string), "Produtos: %d/%d"PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                
SendClientMessage(playeridCOLOR_GREEN"INFO: Vocк pode fornecer produtos para as empresas.");
                
SendClientMessage(playeridCOLOR_GREEN"INFO: Comandos sao: /carga /comprarprodutos /venderprodutos");
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");
            }
        }
        if(
IsASweeper(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 21)
            {
                if(
PlayerIsSweeping[playerid] == 0)
                {
                }
                else
                {
                }
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");
            }
        }
        if(
PlayerKarting[playerid] != 0)
        {
            new 
kart GetPlayerVehicleID(playerid);
            if(
kart >=78 && kart <= 83)
            {
                
PlayerInKart[playerid] = 1;
                
KartingPlayers ++;
            }
        }
        if(
newcar >= 131 && newcar <= 134)
        {
            
SendClientMessage(playerid,COLOR_RED," (( O teste de conduзгo estб desativado )) ");
        }
        if(
newcar == 167)
        {
            
SendClientMessage(playerid,COLOR_RED," (( O teste de vфo estб desativado )) ");
              
RemovePlayerFromVehicle(playerid);
        }
        if(
newcar == 166)
        {
            if(
PlayerInfo[playerid][pMember] == 4) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do caminhгo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar == 38)
        {
            if(
PlayerInfo[playerid][pRank] >= 3) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED,"  Vocк deve estar pelo menos Rank 3 para fazer isso! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 96 && newcar <= 98)
        {
            if(
PlayerInfo[playerid][pJob] != 16)
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do caminhгo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 61 && newcar <= 70)
        {
            if(
PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED,"   Vocк nгo tem as chaves do veiculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 71 && newcar <= 73)
        {
            if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 9){ }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veiculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 78 && newcar <= 83)
        {
            if(
PlayerKarting[playerid] != 1)
            {
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 135 && newcar <= 154)
        {
            if (
HireCar[playerid] != newcar)
            {
                
format(stringsizeof(string), "~w~Vocк pode alugar este carro~n~Costo:~g~$500~n~~w~Para alugar usa ~g~/alugarveiculo~w~~n~Para sair usa ~r~/sair");
                
TogglePlayerControllable(playerid0);
                
GameTextForPlayer(playeridstring50003);
            }
        }
        if(
newcar >= 112 && newcar <= 130)
        {
            if (
HireCar[playerid] != newcar)
            {
                
format(stringsizeof(string), "~w~Vocк pode alugar esta bicicleta~n~Costo:~g~$%d~n~~w~Para alugar usa ~g~/alugarbicicleta~w~~n~Para sair usa ~r~/sair",SBizzInfo[0][sbEntranceCost]);
                
TogglePlayerControllable(playerid0);
                
GameTextForPlayer(playeridstring50003);
            }
        }
        if(
newcar >= 56 && newcar <= 58)
        {
            if(
PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] == 8) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsAHarvest(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 18)
            {
                if(
FarmerVar[playerid] == 0)
                {
                    
SendClientMessage(playeridCOLOR_BLUE"___________Guia Agricultor______________________________");
                    
SendClientMessage(playeridCOLOR_BLUE"** Agricultor ** /iniciarcolheita, /pararcolheita, /sair");
                    
SendClientMessage(playeridCOLOR_BLUE"________________________________________________________");
                    
TogglePlayerControllable(playerid0);
                }
                else { }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsADrugHarvest(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 19)
            {
                
SendClientMessage(playeridCOLOR_BLUE"___________________________Guia Fabricante de Droga_____________________________");
                
SendClientMessage(playeridCOLOR_BLUE"** Fabricante de Droga ** /iniciarcolheitadedroga, /pararcolheitadedroga, /sair");
                
SendClientMessage(playeridCOLOR_BLUE"________________________________________________________________________________");
                
TogglePlayerControllable(playerid0);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsASmuggleCar(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 20)
            {
                if(
PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
                {
                    
SendClientMessage(playeridCOLOR_GREEN"DICA: Vocк pode contrabandear drogas agora!");
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED" Vocк nгo tem as chaves do veнculo! ");
                    
RemovePlayerFromVehicle(playerid);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
oldcar != 301)
        {
            if((
housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
            {
                if(
gLastDriver[oldcar] == playerid && oldcar != newcar)
                {
                    
gLastDriver[oldcar] = 300;
                    
gCarLock[oldcar] = 0;
                    
UnLockCar(oldcar);
                }
            }
        }
        if(
IsAnOwnableCar(newcar))
        {
            if(
CarInfo[newcar][cOwned]==0)
            {
                
TogglePlayerControllable(playerid0);
                
format(string,sizeof(string),"~w~Veнculo: %s~n~Preзo: ~g~%d~n~~w~/v comprar para comprar este Veнculo~n~~r~/sair ~w~para sair do carro",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
                
GameTextForPlayer(playerid,string,5000,5);
            }
            if(
CarInfo[newcar][cOwned]==1)
            {
                
format(string,sizeof(string),"Veнculo Registado por %s",CarInfo[newcar][cOwner]);
                
SendClientMessage(playeridCOLOR_BLUEstring);
                
/*if(keycar != vehicle)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
                }*/
                
if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
                else if(
PlayerInfo[playerid][pPcarkey2] == vehicle) { }
                else if(
PlayerInfo[playerid][pPcarkey3] == vehicle) { }
                else
                {
                    if(
PlayerInfo[playerid][pAdmin] >= && AdminDuty[playerid] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_BLUE" Vocк pode conduzir este carro, porque vocк й o administrador/GameMaster ");
                    }
                    else
                    {
                        
RemovePlayerFromVehicle(playerid);
                        
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem a chave deste veнculo");
                    }
                }
            }
        }
        
gLastCar[playerid] = newcar;
        
gLastDriver[newcar] = playerid;
    }
    if(
newstate == PLAYER_STATE_SPAWNED)
    {
        new 
FloatlwxFloat:lwyFloat:lwz;
        
GetPlayerPos(playeridlwxlwylwz);
        if((
lwz 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
        
{
            
SetPlayerSpawn(playerid);
        }
        if(
WantedPoints[playerid] > 0)
        {
            new 
dstring[128];
            new 
wanted WantedPoints[playerid];
            new 
diecash 0;
            while(
WantedPoints[playerid] > 0)
            {
                
diecash += 500;
                
WantedPoints[playerid] --;
            }
            
format(dstringsizeof(dstring), "Vocк perdeu $%d por morrer %d Pontos Espontвneos."diecashwanted);
            
SendClientMessage(playeridCOLOR_REDdstring);
            
SafeGivePlayerMoney(playerid, - diecash);
            
PlayerInfo[playerid][pWantedDeaths] += 1;
        }
        if(
PlayerOnMission[playerid] > 0)
        {
            
GameTextForPlayer(playerid"~r~Missгo falhada"50003);
            
PlayerOnMission[playerid] = 0;
            
PlayerInfo[playerid][pMissionNr] = 0;
        }
        
WantedPoints[playerid] = 0;
        
WantedLevel[playerid] = 0;
        if(
PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid100.0); }
        else { 
SetPlayerHealth(playerid50.0+PlayerInfo[playerid][pSHealth]); }
        
MedicBill[playerid] = 1;
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        
gPlayerSpawned[playerid] = 1;
        
SafeTime[playerid] = 60;
    }
    return 
1;




Re: [Ajuda]Ajudinha aqui no neon Porfavor - Shadoww5 - 25.06.2011

Vocк quer que a gente observe entre mais de 500 linhas qual chave estб faltando ?

Й melhor vocк postar aqui a ultima modificaзгo feita.


Re: [Ajuda]Ajudinha aqui no neon Porfavor - [Dk]TuReTOo - 25.06.2011

A ultima modifica-sao foi meter esste comando !!!!!!!!!!!!!!!!!!!!!!!!!!!!

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    
#define vehicleid GetPlayerVehicleID(playerid)
    
if(newstate == PLAYER_STATE_DRIVER)
    {
        if (
vehicleid == 44)
        {
            
AttachObjectToVehicle(1864844, -0.80.0, -0.700.00.00.0);
            
AttachObjectToVehicle(18648440.80.0, -0.700.00.00.0);
        }
    }
    return 
1;

dame 26 erros !!!!!!!!

veja a public toda onde posso colocar esse comado !!!!!!!!!!!!!!!!

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new 
string[256];
    new 
pveh GetVehicleModel(GetPlayerVehicleID(playerid));
    new 
vehicle GetPlayerVehicleID(playerid);
    if(
newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        
SetTimerEx("Startup"1false"ii"playeridvehicle);
        
SetTimerEx("engine2"2500false"ii"playerid);
    }
    else if(
newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        
SetTimerEx("Startup"1false"ii"playeridvehicle);
        
SetTimerEx("engine2"2500false"ii"playerid);
    }
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        if(
PlayerKarting[playerid] > && PlayerInKart[playerid] > 0)
        {
            
PlayerInKart[playerid] = 0;
            
KartingPlayers --;
        }
        if(
TransportDuty[playerid] > 0)
        {
            if(
TransportDuty[playerid] == 1)
            {
                
TaxiDrivers -= 1;
            }
            else if(
TransportDuty[playerid] == 2)
            {
                
BusDrivers -= 1;
            }
            
TransportDuty[playerid] = 0;
            
format(stringsizeof(string), "* Vocк estб agora fora de serviзo $%d *"TransportMoney[playerid]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
SafeGivePlayerMoney(playeridTransportMoney[playerid]);
            
/*ConsumingMoney[playerid] = 1;*/ TransportValue[playerid] = 0TransportMoney[playerid] = 0;
        }
        if(
TransportCost[playerid] > && TransportDriver[playerid] < 999)
        {
            if(
IsPlayerConnected(TransportDriver[playerid]))
            {
                
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
                
TransportTime[TransportDriver[playerid]] = 0;
                
TransportCost[TransportDriver[playerid]] = 0;
                
format(stringsizeof(string), "~w~O custo de viagem~n~~r~$%d",TransportCost[playerid]);
                
GameTextForPlayer(playeridstring50001);
                
format(stringsizeof(string), "~w~Passageiro saiu do tбxi~n~~g~Ganhaste: $%d",TransportCost[playerid]);
                
GameTextForPlayer(TransportDriver[playerid], string50001);
                
SafeGivePlayerMoney(playerid, -TransportCost[playerid]);
                
TransportCost[playerid] = 0;
                
TransportTime[playerid] = 0;
                
TransportDriver[playerid] = 999;
            }
        }
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
    }
    if(
newstate == PLAYER_STATE_PASSENGER// TAXI & BUSSES
    
{
        new 
name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        new 
vehicleid GetPlayerVehicleID(playerid);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
IsPlayerInVehicle(ivehicleid) && GetPlayerState(i) == && TransportDuty[i] > 0)
                {
                    if(
GetPlayerMoney(playerid) < TransportValue[i])
                    {
                        
format(stringsizeof(string), "* Vocк precisa $%d para entrar."TransportValue[i]);
                        
SendClientMessage(playeridCOLOR_REDstring);
                        
RemovePlayerFromVehicle(playerid);
                    }
                    else
                    {
                        if(
TransportDuty[i] == 1)
                        {
                            
format(stringsizeof(string), "* Vocк pagou $%d ao taxista."TransportValue[i]);
                            
SendClientMessage(playeridCOLOR_REDstring);
                            
format(stringsizeof(string), "* Passageiro %s entrou no seu taxi."name);
                            
SendClientMessage(iCOLOR_GREENstring);
                            
TransportTime[i] = 1;
                            
TransportTime[playerid] = 1;
                            
TransportCost[playerid] = TransportValue[i];
                            
TransportCost[i] = TransportValue[i];
                            
TransportDriver[playerid] = i;
                        }
                        else if(
TransportDuty[i] == 2)
                        {
                            
format(stringsizeof(string), "* Vocк pagou $%d ao camionista ."TransportValue[i]);
                            
SendClientMessage(playeridCOLOR_REDstring);
                            
format(stringsizeof(string), "* Passageiro %s entrou no seu autocarro."name);
                            
SendClientMessage(iCOLOR_GREENstring);
                        }
                        
SafeGivePlayerMoney(playerid, - TransportValue[i]);
                        
TransportMoney[i] += TransportValue[i];
                    }
                }
            }
        }
    }
    if(
newstate == PLAYER_STATE_WASTED)
    {
        if(
WantedLevel[playerid] >= 1)
        {
            new 
price WantedLevel[playerid] * 1000;
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
gTeam[i] == && CrimInRange(30.0playerid,i))
                    {
                        
count 1;
                        
format(stringsizeof(string), "~w~execuзгo suspeito~r~Assassinado~n~Bфnus~g~$%d"price);
                        
GameTextForPlayer(istring50001);
                        
//ConsumingMoney[i] = 1;
                        
SafeGivePlayerMoney(iprice 2);
                        
PlayerPlaySound(i10580.00.00.0);
                    }
                }
            }
            if(
count == 1)
            {
                
SafeGivePlayerMoney(playerid, - price);
                
PlayerInfo[playerid][pWantedDeaths] += 1;
                
PlayerInfo[playerid][pJailed] = 1;
                
PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
                
format(stringsizeof(string), "* Foste para a prisгo porque cometeste um crime"PlayerInfo[playerid][pJailTime], price);
                
SendClientMessage(playeridCOLOR_REDstring);
                
WantedPoints[playerid] = 0;
                
WantedLevel[playerid] = 0;
            }
        }
    }

    if(
newstate == PLAYER_STATE_DRIVER)
    {
// 38 / 49 / 56 = SS
        
new newcar GetPlayerVehicleID(playerid);
        new 
oldcar gLastCar[playerid];
        new 
housecar PlayerInfo[playerid][pPhousekey]+1;
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        if(
IsABoat(newcar))
  {
            if(
PlayerInfo[playerid][pBoatLic] < 1)
            {
                
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem licenca de vela, diriga com cuidado ou a policia vai notar.");
                
TogglePlayerControllable(playerid1);
            }
        }
        else if(
IsAPlane(newcar))
        {
            if(
PlayerInfo[playerid][pFlyLic] < 1)
            {
                if(
TakingLesson[playerid] == 1) { }
                else {
                
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem licenca de voф, diriga com cuidado ou a policia vai notar.");
                
TogglePlayerControllable(playerid1); }
            }
        }
        else
        {
            if(
PlayerInfo[playerid][pCarLic] < 0)
            {
                if(
PlayerDrunk[playerid] >= 5)
                {
                    
WantedPoints[playerid] += 1;
                    
SetPlayerCriminal(playerid,255"Dirigir embriagado");
                }

            }
            else if(
PlayerDrunk[playerid] >= 5)
            {
                
WantedPoints[playerid] += 1;
                
SetPlayerCriminal(playerid,255"dirigir embriagado");
            }

            if(
PlayerInfo[playerid][pCarLic] < 1)
            {
                if(
IsABike(newcar) || IsAOBike(newcar)) { }
                else
                {
                    
/*if(PlayerInfo[playerid][pCarLic] < 1)
                    {
                        WantedPoints[playerid] += 1;
                        SetPlayerCriminal(playerid,255, "Driving without License");
                    }*/
                    
if(TakingLesson[playerid] == 1) { }
                    else {
                    
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem carta ainda, dirige com cuidado ou a polнcia vai notar");
                  }
                }
            }
        }
//Done with car check
        
if(IsACopCar(newcar))
        {
            if(
IsACop(playerid)) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        if(
IsATank(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pLeader] == 3) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        if(
IsAnFbiCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsNgCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsAGovernmentCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 7||PlayerInfo[playerid][pMember] == 7) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsAHspdCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == && PlayerInfo[playerid][pRank] > 2) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        else if(
IsAnAmbulance(newcar))
        {
            if(
PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        
/*if(IsAGangCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 5||PlayerInfo[playerid][pMember] == 5) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar2(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar3(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 14||PlayerInfo[playerid][pMember] == 14) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar4(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 15) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar5(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 16) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }*/
        
if(IsAPizzabike(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 17) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves desta moto.");}
        }
        if(
IsABus(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 14)
            {
                
GameTextForPlayer(playerid"~w~Usa /comecaraleste ou /comecaraoeste para comecar a sua rota de autocarro"50003);
                
SendClientMessage(playeridCOLOR_GREEN"Vocк jб entrou num autocarro, usa /sair para cancelar a seleзгo de rota.");
                
//GangZoneShowForPlayer(playerid, buszonewest, COLOR_RED);
                //GangZoneShowForPlayer(playerid, buszoneeast, COLOR_BLUE);
                
SendClientMessage(playeridCOLOR_GREEN"Para comeзar a fazer a rota oeste, usa /comecaraoeste. Para comeзar a fazer a rota leste, usa /comecaraleste.");
                new 
routezonecheck IsInBusrouteZone(playerid);
                if (
routezonecheck == 0SendClientMessage(playeridCOLOR_GREEN"Nota: O prуximo caminho й o leste.");
                else if (
routezonecheck == 1SendClientMessage(playeridCOLOR_GREEN"Nota: O caminho mais prуximo fica a oeste.");
                
TogglePlayerControllable(playerid0);
            }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do autocarro.");}
        }
        if(
IsATowcar(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 7) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsATruck(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 16)
            {
                
format(stringsizeof(string), "Produtos: %d/%d"PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                
SendClientMessage(playeridCOLOR_GREEN"INFO: Vocк pode fornecer produtos para as empresas.");
                
SendClientMessage(playeridCOLOR_GREEN"INFO: Comandos sao: /carga /comprarprodutos /venderprodutos");
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");
            }
        }
        if(
IsASweeper(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 21)
            {
                if(
PlayerIsSweeping[playerid] == 0)
                {
                }
                else
                {
                }
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");
            }
        }
        if(
PlayerKarting[playerid] != 0)
        {
            new 
kart GetPlayerVehicleID(playerid);
            if(
kart >=78 && kart <= 83)
            {
                
PlayerInKart[playerid] = 1;
                
KartingPlayers ++;
            }
        }
        if(
newcar >= 131 && newcar <= 134)
        {
            
SendClientMessage(playerid,COLOR_RED," (( O teste de conduзгo estб desativado )) ");
        }
        if(
newcar == 167)
        {
            
SendClientMessage(playerid,COLOR_RED," (( O teste de vфo estб desativado )) ");
              
RemovePlayerFromVehicle(playerid);
        }
        if(
newcar == 166)
        {
            if(
PlayerInfo[playerid][pMember] == 4) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do caminhгo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar == 38)
        {
            if(
PlayerInfo[playerid][pRank] >= 3) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED,"  Vocк deve estar pelo menos Rank 3 para fazer isso! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 96 && newcar <= 98)
        {
            if(
PlayerInfo[playerid][pJob] != 16)
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do caminhгo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 61 && newcar <= 70)
        {
            if(
PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED,"   Vocк nгo tem as chaves do veiculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 71 && newcar <= 73)
        {
            if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 9){ }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veiculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 78 && newcar <= 83)
        {
            if(
PlayerKarting[playerid] != 1)
            {
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 135 && newcar <= 154)
        {
            if (
HireCar[playerid] != newcar)
            {
                
format(stringsizeof(string), "~w~Vocк pode alugar este carro~n~Costo:~g~$500~n~~w~Para alugar usa ~g~/alugarveiculo~w~~n~Para sair usa ~r~/sair");
                
TogglePlayerControllable(playerid0);
                
GameTextForPlayer(playeridstring50003);
            }
        }
        if(
newcar >= 112 && newcar <= 130)
        {
            if (
HireCar[playerid] != newcar)
            {
                
format(stringsizeof(string), "~w~Vocк pode alugar esta bicicleta~n~Costo:~g~$%d~n~~w~Para alugar usa ~g~/alugarbicicleta~w~~n~Para sair usa ~r~/sair",SBizzInfo[0][sbEntranceCost]);
                
TogglePlayerControllable(playerid0);
                
GameTextForPlayer(playeridstring50003);
            }
        }
        if(
newcar >= 56 && newcar <= 58)
        {
            if(
PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] == 8) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsAHarvest(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 18)
            {
                if(
FarmerVar[playerid] == 0)
                {
                    
SendClientMessage(playeridCOLOR_BLUE"___________Guia Agricultor______________________________");
                    
SendClientMessage(playeridCOLOR_BLUE"** Agricultor ** /iniciarcolheita, /pararcolheita, /sair");
                    
SendClientMessage(playeridCOLOR_BLUE"________________________________________________________");
                    
TogglePlayerControllable(playerid0);
                }
                else { }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsADrugHarvest(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 19)
            {
                
SendClientMessage(playeridCOLOR_BLUE"___________________________Guia Fabricante de Droga_____________________________");
                
SendClientMessage(playeridCOLOR_BLUE"** Fabricante de Droga ** /iniciarcolheitadedroga, /pararcolheitadedroga, /sair");
                
SendClientMessage(playeridCOLOR_BLUE"________________________________________________________________________________");
                
TogglePlayerControllable(playerid0);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsASmuggleCar(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 20)
            {
                if(
PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
                {
                    
SendClientMessage(playeridCOLOR_GREEN"DICA: Vocк pode contrabandear drogas agora!");
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED" Vocк nгo tem as chaves do veнculo! ");
                    
RemovePlayerFromVehicle(playerid);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
oldcar != 301)
        {
            if((
housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
            {
                if(
gLastDriver[oldcar] == playerid && oldcar != newcar)
                {
                    
gLastDriver[oldcar] = 300;
                    
gCarLock[oldcar] = 0;
                    
UnLockCar(oldcar);
                }
            }
        }
        if(
IsAnOwnableCar(newcar))
        {
            if(
CarInfo[newcar][cOwned]==0)
            {
                
TogglePlayerControllable(playerid0);
                
format(string,sizeof(string),"~w~Veнculo: %s~n~Preзo: ~g~%d~n~~w~/v comprar para comprar este Veнculo~n~~r~/sair ~w~para sair do carro",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
                
GameTextForPlayer(playerid,string,5000,5);
            }
            if(
CarInfo[newcar][cOwned]==1)
            {
                
format(string,sizeof(string),"Veнculo Registado por %s",CarInfo[newcar][cOwner]);
                
SendClientMessage(playeridCOLOR_BLUEstring);
                
/*if(keycar != vehicle)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
                }*/
                
if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
                else if(
PlayerInfo[playerid][pPcarkey2] == vehicle) { }
                else if(
PlayerInfo[playerid][pPcarkey3] == vehicle) { }
                else
                {
                    if(
PlayerInfo[playerid][pAdmin] >= && AdminDuty[playerid] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_BLUE" Vocк pode conduzir este carro, porque vocк й o administrador/GameMaster ");
                    }
                    else
                    {
                        
RemovePlayerFromVehicle(playerid);
                        
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem a chave deste veнculo");
                    }
                }
            }
        }
        
gLastCar[playerid] = newcar;
        
gLastDriver[newcar] = playerid;
    }
    if(
newstate == PLAYER_STATE_SPAWNED)
    {
        new 
FloatlwxFloat:lwyFloat:lwz;
        
GetPlayerPos(playeridlwxlwylwz);
        if((
lwz 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
        
{
            
SetPlayerSpawn(playerid);
        }
        if(
WantedPoints[playerid] > 0)
        {
            new 
dstring[128];
            new 
wanted WantedPoints[playerid];
            new 
diecash 0;
            while(
WantedPoints[playerid] > 0)
            {
                
diecash += 500;
                
WantedPoints[playerid] --;
            }
            
format(dstringsizeof(dstring), "Vocк perdeu $%d por morrer %d Pontos Espontвneos."diecashwanted);
            
SendClientMessage(playeridCOLOR_REDdstring);
            
SafeGivePlayerMoney(playerid, - diecash);
            
PlayerInfo[playerid][pWantedDeaths] += 1;
        }
        if(
PlayerOnMission[playerid] > 0)
        {
            
GameTextForPlayer(playerid"~r~Missгo falhada"50003);
            
PlayerOnMission[playerid] = 0;
            
PlayerInfo[playerid][pMissionNr] = 0;
        }
        
WantedPoints[playerid] = 0;
        
WantedLevel[playerid] = 0;
        if(
PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid100.0); }
        else { 
SetPlayerHealth(playerid50.0+PlayerInfo[playerid][pSHealth]); }
        
MedicBill[playerid] = 1;
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        
gPlayerSpawned[playerid] = 1;
        
SafeTime[playerid] = 60;
    }
    return 
1;

foi isto que disse no post antrior.. e presiso 1 semana para me ajudarem aqui ? kkkkk


Re: [Ajuda]Ajudinha aqui no neon Porfavor - Ricop522 - 25.06.2011

Cria o veнculo desse jeito..

new veiculo;
veiculo = Addstaticvehicleex(..)

if(vehicleid == veiculo)..


Re: [Ajuda]Ajudinha aqui no neon Porfavor - [Dk]TuReTOo - 25.06.2011

Nгo quero criar veiculo ainda nao preseveu? meu server й Rolle Play !! o veiculo ja esta criado no bloco de notas chamado "Cars.cfg" !! fgo.. dizem que e facil meter o carro com neon no gamemode afinal naoo, alguem me diga em que parte da public OnPlayerStateChange(playerid, newstate, oldstate) eu meto este sistema

PHP код:
#define vehicleid GetPlayerVehicleID(playerid)
    
if(newstate == PLAYER_STATE_DRIVER)
    {
        if (
vehicleid == 44)
        {
            
AttachObjectToVehicle(1864844, -0.80.0, -0.700.00.00.0);
            
AttachObjectToVehicle(18648440.80.0, -0.700.00.00.0);
        }
    }
    return 
1;

aqui esta a public, onde coloco o sistema de cima ?

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new 
string[256];
    new 
pveh GetVehicleModel(GetPlayerVehicleID(playerid));
    new 
vehicle GetPlayerVehicleID(playerid);
    if(
newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        
SetTimerEx("Startup"1false"ii"playeridvehicle);
        
SetTimerEx("engine2"2500false"ii"playerid);
    }
    else if(
newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
    {
        
SetTimerEx("Startup"1false"ii"playeridvehicle);
        
SetTimerEx("engine2"2500false"ii"playerid);
    }
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        if(
PlayerKarting[playerid] > && PlayerInKart[playerid] > 0)
        {
            
PlayerInKart[playerid] = 0;
            
KartingPlayers --;
        }
        if(
TransportDuty[playerid] > 0)
        {
            if(
TransportDuty[playerid] == 1)
            {
                
TaxiDrivers -= 1;
            }
            else if(
TransportDuty[playerid] == 2)
            {
                
BusDrivers -= 1;
            }
            
TransportDuty[playerid] = 0;
            
format(stringsizeof(string), "* Vocк estб agora fora de serviзo $%d *"TransportMoney[playerid]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
            
SafeGivePlayerMoney(playeridTransportMoney[playerid]);
            
/*ConsumingMoney[playerid] = 1;*/ TransportValue[playerid] = 0TransportMoney[playerid] = 0;
        }
        if(
TransportCost[playerid] > && TransportDriver[playerid] < 999)
        {
            if(
IsPlayerConnected(TransportDriver[playerid]))
            {
                
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
                
TransportTime[TransportDriver[playerid]] = 0;
                
TransportCost[TransportDriver[playerid]] = 0;
                
format(stringsizeof(string), "~w~O custo de viagem~n~~r~$%d",TransportCost[playerid]);
                
GameTextForPlayer(playeridstring50001);
                
format(stringsizeof(string), "~w~Passageiro saiu do tбxi~n~~g~Ganhaste: $%d",TransportCost[playerid]);
                
GameTextForPlayer(TransportDriver[playerid], string50001);
                
SafeGivePlayerMoney(playerid, -TransportCost[playerid]);
                
TransportCost[playerid] = 0;
                
TransportTime[playerid] = 0;
                
TransportDriver[playerid] = 999;
            }
        }
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
    }
    if(
newstate == PLAYER_STATE_PASSENGER// TAXI & BUSSES
    
{
        new 
name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        new 
vehicleid GetPlayerVehicleID(playerid);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
IsPlayerInVehicle(ivehicleid) && GetPlayerState(i) == && TransportDuty[i] > 0)
                {
                    if(
GetPlayerMoney(playerid) < TransportValue[i])
                    {
                        
format(stringsizeof(string), "* Vocк precisa $%d para entrar."TransportValue[i]);
                        
SendClientMessage(playeridCOLOR_REDstring);
                        
RemovePlayerFromVehicle(playerid);
                    }
                    else
                    {
                        if(
TransportDuty[i] == 1)
                        {
                            
format(stringsizeof(string), "* Vocк pagou $%d ao taxista."TransportValue[i]);
                            
SendClientMessage(playeridCOLOR_REDstring);
                            
format(stringsizeof(string), "* Passageiro %s entrou no seu taxi."name);
                            
SendClientMessage(iCOLOR_GREENstring);
                            
TransportTime[i] = 1;
                            
TransportTime[playerid] = 1;
                            
TransportCost[playerid] = TransportValue[i];
                            
TransportCost[i] = TransportValue[i];
                            
TransportDriver[playerid] = i;
                        }
                        else if(
TransportDuty[i] == 2)
                        {
                            
format(stringsizeof(string), "* Vocк pagou $%d ao camionista ."TransportValue[i]);
                            
SendClientMessage(playeridCOLOR_REDstring);
                            
format(stringsizeof(string), "* Passageiro %s entrou no seu autocarro."name);
                            
SendClientMessage(iCOLOR_GREENstring);
                        }
                        
SafeGivePlayerMoney(playerid, - TransportValue[i]);
                        
TransportMoney[i] += TransportValue[i];
                    }
                }
            }
        }
    }
    if(
newstate == PLAYER_STATE_WASTED)
    {
        if(
WantedLevel[playerid] >= 1)
        {
            new 
price WantedLevel[playerid] * 1000;
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
gTeam[i] == && CrimInRange(30.0playerid,i))
                    {
                        
count 1;
                        
format(stringsizeof(string), "~w~execuзгo suspeito~r~Assassinado~n~Bфnus~g~$%d"price);
                        
GameTextForPlayer(istring50001);
                        
//ConsumingMoney[i] = 1;
                        
SafeGivePlayerMoney(iprice 2);
                        
PlayerPlaySound(i10580.00.00.0);
                    }
                }
            }
            if(
count == 1)
            {
                
SafeGivePlayerMoney(playerid, - price);
                
PlayerInfo[playerid][pWantedDeaths] += 1;
                
PlayerInfo[playerid][pJailed] = 1;
                
PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
                
format(stringsizeof(string), "* Foste para a prisгo porque cometeste um crime"PlayerInfo[playerid][pJailTime], price);
                
SendClientMessage(playeridCOLOR_REDstring);
                
WantedPoints[playerid] = 0;
                
WantedLevel[playerid] = 0;
            }
        }
    }

    if(
newstate == PLAYER_STATE_DRIVER)
    {
// 38 / 49 / 56 = SS
        
new newcar GetPlayerVehicleID(playerid);
        new 
oldcar gLastCar[playerid];
        new 
housecar PlayerInfo[playerid][pPhousekey]+1;
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        if(
IsABoat(newcar))
  {
            if(
PlayerInfo[playerid][pBoatLic] < 1)
            {
                
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem licenca de vela, diriga com cuidado ou a policia vai notar.");
                
TogglePlayerControllable(playerid1);
            }
        }
        else if(
IsAPlane(newcar))
        {
            if(
PlayerInfo[playerid][pFlyLic] < 1)
            {
                if(
TakingLesson[playerid] == 1) { }
                else {
                
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem licenca de voф, diriga com cuidado ou a policia vai notar.");
                
TogglePlayerControllable(playerid1); }
            }
        }
        else
        {
            if(
PlayerInfo[playerid][pCarLic] < 0)
            {
                if(
PlayerDrunk[playerid] >= 5)
                {
                    
WantedPoints[playerid] += 1;
                    
SetPlayerCriminal(playerid,255"Dirigir embriagado");
                }

            }
            else if(
PlayerDrunk[playerid] >= 5)
            {
                
WantedPoints[playerid] += 1;
                
SetPlayerCriminal(playerid,255"dirigir embriagado");
            }

            if(
PlayerInfo[playerid][pCarLic] < 1)
            {
                if(
IsABike(newcar) || IsAOBike(newcar)) { }
                else
                {
                    
/*if(PlayerInfo[playerid][pCarLic] < 1)
                    {
                        WantedPoints[playerid] += 1;
                        SetPlayerCriminal(playerid,255, "Driving without License");
                    }*/
                    
if(TakingLesson[playerid] == 1) { }
                    else {
                    
SendClientMessage(playeridCOLOR_RED"   Vocк nгo tem carta ainda, dirige com cuidado ou a polнcia vai notar");
                  }
                }
            }
        }
//Done with car check
        
if(IsACopCar(newcar))
        {
            if(
IsACop(playerid)) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        if(
IsATank(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pLeader] == 3) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        if(
IsAnFbiCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsNgCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsAGovernmentCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 7||PlayerInfo[playerid][pMember] == 7) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsAHspdCar(newcar))
        {
            if(
PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == && PlayerInfo[playerid][pRank] > 2) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        else if(
IsAnAmbulance(newcar))
        {
            if(
PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
            else { 
RemovePlayerFromVehicle(playerid); }
        }
        
/*if(IsAGangCar(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 5||PlayerInfo[playerid][pMember] == 5) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar2(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar3(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 14||PlayerInfo[playerid][pMember] == 14) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar4(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 15||PlayerInfo[playerid][pMember] == 15) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }
        if(IsAGangCar5(newcar))
        {
            if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 16) { }
            else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, COLOR_GREY,"You don't have keys of this vehicle.");}
        }*/
        
if(IsAPizzabike(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 17) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves desta moto.");}
        }
        if(
IsABus(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 14)
            {
                
GameTextForPlayer(playerid"~w~Usa /comecaraleste ou /comecaraoeste para comecar a sua rota de autocarro"50003);
                
SendClientMessage(playeridCOLOR_GREEN"Vocк jб entrou num autocarro, usa /sair para cancelar a seleзгo de rota.");
                
//GangZoneShowForPlayer(playerid, buszonewest, COLOR_RED);
                //GangZoneShowForPlayer(playerid, buszoneeast, COLOR_BLUE);
                
SendClientMessage(playeridCOLOR_GREEN"Para comeзar a fazer a rota oeste, usa /comecaraoeste. Para comeзar a fazer a rota leste, usa /comecaraleste.");
                new 
routezonecheck IsInBusrouteZone(playerid);
                if (
routezonecheck == 0SendClientMessage(playeridCOLOR_GREEN"Nota: O prуximo caminho й o leste.");
                else if (
routezonecheck == 1SendClientMessage(playeridCOLOR_GREEN"Nota: O caminho mais prуximo fica a oeste.");
                
TogglePlayerControllable(playerid0);
            }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do autocarro.");}
        }
        if(
IsATowcar(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 7) { }
            else {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");}
        }
        if(
IsATruck(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 16)
            {
                
format(stringsizeof(string), "Produtos: %d/%d"PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
                
SendClientMessage(playeridTEAM_GROVE_COLORstring);
                
SendClientMessage(playeridCOLOR_GREEN"INFO: Vocк pode fornecer produtos para as empresas.");
                
SendClientMessage(playeridCOLOR_GREEN"INFO: Comandos sao: /carga /comprarprodutos /venderprodutos");
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");
            }
        }
        if(
IsASweeper(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 21)
            {
                if(
PlayerIsSweeping[playerid] == 0)
                {
                }
                else
                {
                }
            }
            else
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playeridCOLOR_RED,"Vocк nгo tem as chaves do veнculo.");
            }
        }
        if(
PlayerKarting[playerid] != 0)
        {
            new 
kart GetPlayerVehicleID(playerid);
            if(
kart >=78 && kart <= 83)
            {
                
PlayerInKart[playerid] = 1;
                
KartingPlayers ++;
            }
        }
        if(
newcar >= 131 && newcar <= 134)
        {
            
SendClientMessage(playerid,COLOR_RED," (( O teste de conduзгo estб desativado )) ");
        }
        if(
newcar == 167)
        {
            
SendClientMessage(playerid,COLOR_RED," (( O teste de vфo estб desativado )) ");
              
RemovePlayerFromVehicle(playerid);
        }
        if(
newcar == 166)
        {
            if(
PlayerInfo[playerid][pMember] == 4) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do caminhгo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar == 38)
        {
            if(
PlayerInfo[playerid][pRank] >= 3) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED,"  Vocк deve estar pelo menos Rank 3 para fazer isso! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 96 && newcar <= 98)
        {
            if(
PlayerInfo[playerid][pJob] != 16)
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do caminhгo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 61 && newcar <= 70)
        {
            if(
PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED,"   Vocк nгo tem as chaves do veiculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 71 && newcar <= 73)
        {
            if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 9){ }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veiculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 78 && newcar <= 83)
        {
            if(
PlayerKarting[playerid] != 1)
            {
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
newcar >= 135 && newcar <= 154)
        {
            if (
HireCar[playerid] != newcar)
            {
                
format(stringsizeof(string), "~w~Vocк pode alugar este carro~n~Costo:~g~$500~n~~w~Para alugar usa ~g~/alugarveiculo~w~~n~Para sair usa ~r~/sair");
                
TogglePlayerControllable(playerid0);
                
GameTextForPlayer(playeridstring50003);
            }
        }
        if(
newcar >= 112 && newcar <= 130)
        {
            if (
HireCar[playerid] != newcar)
            {
                
format(stringsizeof(string), "~w~Vocк pode alugar esta bicicleta~n~Costo:~g~$%d~n~~w~Para alugar usa ~g~/alugarbicicleta~w~~n~Para sair usa ~r~/sair",SBizzInfo[0][sbEntranceCost]);
                
TogglePlayerControllable(playerid0);
                
GameTextForPlayer(playeridstring50003);
            }
        }
        if(
newcar >= 56 && newcar <= 58)
        {
            if(
PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] == 8) { }
            else
            {
                
SendClientMessage(playerid,COLOR_RED," Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsAHarvest(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 18)
            {
                if(
FarmerVar[playerid] == 0)
                {
                    
SendClientMessage(playeridCOLOR_BLUE"___________Guia Agricultor______________________________");
                    
SendClientMessage(playeridCOLOR_BLUE"** Agricultor ** /iniciarcolheita, /pararcolheita, /sair");
                    
SendClientMessage(playeridCOLOR_BLUE"________________________________________________________");
                    
TogglePlayerControllable(playerid0);
                }
                else { }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsADrugHarvest(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 19)
            {
                
SendClientMessage(playeridCOLOR_BLUE"___________________________Guia Fabricante de Droga_____________________________");
                
SendClientMessage(playeridCOLOR_BLUE"** Fabricante de Droga ** /iniciarcolheitadedroga, /pararcolheitadedroga, /sair");
                
SendClientMessage(playeridCOLOR_BLUE"________________________________________________________________________________");
                
TogglePlayerControllable(playerid0);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
IsASmuggleCar(newcar))
        {
            if(
PlayerInfo[playerid][pJob] == 20)
            {
                if(
PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
                {
                    
SendClientMessage(playeridCOLOR_GREEN"DICA: Vocк pode contrabandear drogas agora!");
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_RED" Vocк nгo tem as chaves do veнculo! ");
                    
RemovePlayerFromVehicle(playerid);
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"  Vocк nгo tem as chaves do veнculo! ");
                
RemovePlayerFromVehicle(playerid);
            }
        }
        if(
oldcar != 301)
        {
            if((
housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
            {
                if(
gLastDriver[oldcar] == playerid && oldcar != newcar)
                {
                    
gLastDriver[oldcar] = 300;
                    
gCarLock[oldcar] = 0;
                    
UnLockCar(oldcar);
                }
            }
        }
        if(
IsAnOwnableCar(newcar))
        {
            if(
CarInfo[newcar][cOwned]==0)
            {
                
TogglePlayerControllable(playerid0);
                
format(string,sizeof(string),"~w~Veнculo: %s~n~Preзo: ~g~%d~n~~w~/v comprar para comprar este Veнculo~n~~r~/sair ~w~para sair do carro",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
                
GameTextForPlayer(playerid,string,5000,5);
            }
            if(
CarInfo[newcar][cOwned]==1)
            {
                
format(string,sizeof(string),"Veнculo Registado por %s",CarInfo[newcar][cOwner]);
                
SendClientMessage(playeridCOLOR_BLUEstring);
                
/*if(keycar != vehicle)
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
                }*/
                
if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
                else if(
PlayerInfo[playerid][pPcarkey2] == vehicle) { }
                else if(
PlayerInfo[playerid][pPcarkey3] == vehicle) { }
                else
                {
                    if(
PlayerInfo[playerid][pAdmin] >= && AdminDuty[playerid] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_BLUE" Vocк pode conduzir este carro, porque vocк й o administrador/GameMaster ");
                    }
                    else
                    {
                        
RemovePlayerFromVehicle(playerid);
                        
SendClientMessage(playeridCOLOR_RED"Vocк nгo tem a chave deste veнculo");
                    }
                }
            }
        }
        
gLastCar[playerid] = newcar;
        
gLastDriver[newcar] = playerid;
    }
    if(
newstate == PLAYER_STATE_SPAWNED)
    {
        new 
FloatlwxFloat:lwyFloat:lwz;
        
GetPlayerPos(playeridlwxlwylwz);
        if((
lwz 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
        
{
            
SetPlayerSpawn(playerid);
        }
        if(
WantedPoints[playerid] > 0)
        {
            new 
dstring[128];
            new 
wanted WantedPoints[playerid];
            new 
diecash 0;
            while(
WantedPoints[playerid] > 0)
            {
                
diecash += 500;
                
WantedPoints[playerid] --;
            }
            
format(dstringsizeof(dstring), "Vocк perdeu $%d por morrer %d Pontos Espontвneos."diecashwanted);
            
SendClientMessage(playeridCOLOR_REDdstring);
            
SafeGivePlayerMoney(playerid, - diecash);
            
PlayerInfo[playerid][pWantedDeaths] += 1;
        }
        if(
PlayerOnMission[playerid] > 0)
        {
            
GameTextForPlayer(playerid"~r~Missгo falhada"50003);
            
PlayerOnMission[playerid] = 0;
            
PlayerInfo[playerid][pMissionNr] = 0;
        }
        
WantedPoints[playerid] = 0;
        
WantedLevel[playerid] = 0;
        if(
PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid100.0); }
        else { 
SetPlayerHealth(playerid50.0+PlayerInfo[playerid][pSHealth]); }
        
MedicBill[playerid] = 1;
        
TelePos[playerid][0] = 0.0;
        
TelePos[playerid][1] = 0.0;
        
gPlayerSpawned[playerid] = 1;
        
SafeTime[playerid] = 60;
    }
    return 
1;