[Ajuda] Quero Que Nao Precise de Liзenзas
#1

No RespawnCivil Quando Pegar o Carro , e ligar motor , qeria q nao precisa-se de Licenca . alguem me ajuda ?
Reply
#2

mande a sua public OnPlayerStateChange.
Reply
#3

PHP код:
 public OnPlayerStateChange(playeridnewstateoldstate)
{
    new 
string[300];
    new 
gstring[128];
    new 
vehicleid GetPlayerVehicleID(playerid);
    
s_tate[playerid] = newstate;
    if(
oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
    {
        if(
GetPVarInt(playerid"VarFPS"))
        {
            if(
IsValidObject(dcObject[playerid])==1)DestroyObject(dcObject[playerid]);
            
SetCameraBehindPlayer(playerid);
            
SetPVarInt(playerid"VarFPS"0);
        }
    }


    if(
newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        if(!
TextShow[playerid])
        {
            
ShowVelo(playerid);
            
TextShow[playerid] = true;
        }
    }
    else
    {
        if(
TextShow[playerid])
        {
            
HideVelo(playerid);
            
TextShow[playerid] = false;
        }
    }
    if(
newstate == PLAYER_STATE_PASSENGER)
    {
        if (
GetVehicleModel(vehicleid) == 431 || GetVehicleModel(vehicleid) == 437)
        {
            
SendClientMessage(playeridCOLOR_YELLOW"*Para ir ao Fundo do Onibus use /fundoonibus");
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        
CheckChave(playeridvehicleid);
        if(
PlayerHaul[vehicleid][pCapasity] > 49)
        {
            
format(stringsizeof(string), "%d",PlayerHaul[vehicleid][pLoad]);
            
PlayerTextDrawSetString(playerid,Produtosnb[playerid], string);
            
format(stringsizeof(string), "%d",PlayerHaul[vehicleid][pCapasity]);
            
PlayerTextDrawSetString(playerid,MaxProdutosnb[playerid], string);
            
ShowCami(playerid);
        }
        if(
IsAAlugHeli(GetPlayerVehicleID(playerid)))
        {
            if (
HireCar[playerid] != vehicleid)
            {
                new 
Aluguelbox[256];
                
format(Aluguelboxsizeof(Aluguelbox),"Esta Aeronave pode ser alugada Preзo:R$%d\nDeseja Aluga-la ?"SBizzInfo[15][sbEntranceCost]);
                
Controle(playerid0);
                   
ShowPlayerDialog(playerid,  DIALOG_ALUGAR2DIALOG_STYLE_MSGBOX"Aluguel de Aeronaves"Aluguelbox"Sim""Nгo");
            }
        }
        if(
IsARespCar(GetPlayerVehicleID(playerid)))
        {
            
empmoney(playerid2050);
        }
    }

    if(
IsPlayerNPC(playerid)) return 1;
    if(
newstate != PLAYER_STATE_DRIVER)
    {
        
SetPlayerTeam(playeridGetPlayerOrg(playerid));
        
pvehicleid[playerid] = 0;
        
pmodelid[playerid] = 0;
        if(
MecanicMission[playerid])
            
EndMission(playerid);

        if(
PlayerInCorrida[playerid])
        {
            
format(stringsizeof string"*** %s saiu de seu carro de corrida e foi desclassificado.",NomePlayer(playerid));
            foreach(
Playeri)
            {
                if(
PlayerInCorrida[i])
                {
                    
SendClientMessage(iCOLOR_LIGHTREDstring);
                }
            }
            
PlayerInCorrida[playerid] = false;
            
SetVehicleToRespawn(gLastCar[playerid]);
            
DisablePlayerRaceCheckpoint(playerid);
              
SetPlayerPos(playeridSBizzInfo[25][sbEntranceX],SBizzInfo[25][sbEntranceY], SBizzInfo[25][sbEntranceZ]);
              
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
        }
    }
    if(
newstate == PLAYER_STATE_PASSENGER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 427)
    {
        if(
GetPlayerVehicleSeat(playerid) == || GetPlayerVehicleSeat(playerid) == 3)
        {
            if(
Watching[playerid] == 0)
            {
                
Inenforcer[playerid] = GetPlayerVehicleID(playerid);
                
SetPlayerVirtualWorld(playeridInenforcer[playerid]);
                 
SetPlayerPos(playerid2084.479980, -1374.8259283000.628052);
                 
SetPlayerFacingAngle(playerid0);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid1);
            }
        }
    }
    if(
newstate == PLAYER_STATE_ONFOOT)
    {
        
HideCami(playerid);
        foreach(
Playeri)
        {
            if(
PlayerInfo[i][pAdmin] && Spectate[i] == playerid)
            {
                
PlayerSpectatePlayer(iplayerid);
            }
        }
        if(
Watching[playerid] > 0)
        {
            
Watching[playerid] = 0;
        }
        if(
PlayerKarting[playerid] > && PlayerInKart[playerid] > 0)
        {
            
PlayerInKart[playerid] = 0;
            
KartingPlayers --;
        }
        if(
TransportDuty[playerid] > 0)
        {
            if(
TransportDuty[playerid] == 1)
            {
                
TaxiDrivers -= 1;
                
HideTaxi(playerid);
            }
            else if(
TransportDuty[playerid] == 2)
            {
                
BusDrivers -= 1;
            }
            
TransportDuty[playerid] = 0;
            
format(gstringsizeof(gstring), "* Estб fora de serviзo, ganhou R$%d."TransportMoney[playerid]);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring);
            
GiveDinheiro(playeridTransportMoney[playerid]);
            
PLO += TransportMoney[playerid];
            
DepositarOrgGrana(7,TransportMoney[playerid]);
            
TransportValue[playerid] = 0;
            
TransportMoney[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(gstringsizeof(gstring), "~w~Custo da corrida~n~~r~R$%d",TransportCost[playerid]);
                
GameTextForPlayer(playeridgstring50001);
                
HideTaxi(playerid);
                
format(gstringsizeof(gstring), "Taximetro:~r~0/0");
                
PlayerTextDrawSetString(TransportDriver[playerid],Taxim[TransportDriver[playerid]], gstring);
                
format(gstringsizeof(gstring), "$00000");
                
PlayerTextDrawSetString(TransportDriver[playerid],ValorTaxi[TransportDriver[playerid]], gstring);
                
format(gstringsizeof(gstring), "Passageiro:~n~~w~Ninguem");
                
PlayerTextDrawSetString(TransportDriver[playerid],passtaxi[TransportDriver[playerid]], gstring);
                
format(gstringsizeof(gstring), "~w~Passageiro saiu do taxi~n~~g~ganhou R$%d",TransportCost[playerid]);
                
GameTextForPlayer(TransportDriver[playerid], gstring50001);
                
GiveDinheiro(playerid, -TransportCost[playerid]);
                
TransportCost[playerid] = 0;
                
TransportTime[playerid] = 0;
                
TransportDriver[playerid] = 999;
            }
        }
    }
    if(
newstate == PLAYER_STATE_PASSENGER// TAXI, BUSSES, BOTS
    
{
        foreach(
Playeri)
        {
            if(
PlayerInfo[i][pAdmin] && Spectate[i] == playerid)
            {
                
PlayerSpectateVehicle(iGetPlayerVehicleID(playerid));
            }
        }


        
pvehicleid[playerid] = GetPlayerVehicleID(playerid);
        
pmodelid[playerid] = GetVehicleModel(pvehicleid[playerid]);

        
format(stringsizeof(string), "%s"veehName[GetVehicleModel(pvehicleid[playerid])-400]);
        
PlayerTextDrawSetString(playeridNomeVehicle[playerid], string);
        
PlayerTextDrawSetString(playeridTextaviao11[playerid], string);

        new 
name[MAX_PLAYER_NAME];
           new 
arma GetPlayerWeapon(playerid);
        
GetPlayerName(playeridnamesizeof(name));
        if(
arma == 24 || arma == 25)
        {
            
SetPlayerArmedWeapon(playerid29);
            
SendClientMessage(playeridCOLOR_GRAD1"Proibido entrar de passageiro com esta arma, ela foi retirada de sua mгo!");
        }
        foreach(
Playeri)
        {
            if(
IsPlayerInVehicle(ivehicleid) && GetPlayerState(i) == && TransportDuty[i] > 0)
            {
                if(
GetPlayerMoney(playerid) < TransportValue[i])
                {
                    
format(gstringsizeof(gstring), "* Vocк precisa de R$%d para entrar."TransportValue[i]);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring);
                    
RemovePlayerFromVehicleEx(playerid);
                }
                else
                {
                    if(
TransportDuty[i] == 1)
                    {
                        
format(gstringsizeof(gstring), "* Pagou R$%d para o taxista."TransportValue[i]);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring);
                        
ShowTaxi(playerid);
                        
format(gstringsizeof(gstring), "* Passageiro %s entrou no Taxi."name);
                        
SendClientMessage(iCOLOR_LIGHTBLUEgstring);
                        
TransportTime[i] = 1;
                        
TransportPlayer[playerid] = i;
                        
TransportPlayer[i] = playerid;
                           
TransportTime[playerid] = 1;
                           
TransportCost[playerid] = TransportValue[i];
                           
TransportCost[i] = TransportValue[i];
                           
TransportDriver[playerid] = i;
                           
format(gstringsizeof(gstring), "Passageiro:~n~%s"name);
                        
PlayerTextDrawSetString(i,passtaxi[i], gstring);
                        
format(gstringsizeof(gstring), "Motorista:~n~%s"NomePlayer(i));
                        
PlayerTextDrawSetString(playerid,passtaxi[playerid], gstring);
                    }
                    else if(
TransportDuty[i] == 2)
                    {
                        
format(gstringsizeof(gstring), "* Pagou R$%d para o Motorista De Onibus."TransportValue[i]);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEgstring);
                        
format(gstringsizeof(gstring), "* Passageiro %s entrou no Onibus."name);
                        
SendClientMessage(iCOLOR_LIGHTBLUEgstring);
                    }
                    
GiveDinheiro(playerid, - TransportValue[i]);
                    
TransportMoney[i] += TransportValue[i];
                }
            }
        }
    }
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        foreach(
Playeri)
        {
            if(
PlayerInfo[i][pAdmin] && Spectate[i] == playerid)
            {
                
PlayerSpectateVehicle(iGetPlayerVehicleID(playerid));
            }
        }


        
pvehicleid[playerid] = GetPlayerVehicleID(playerid);
        
pmodelid[playerid] = GetVehicleModel(pvehicleid[playerid]);

        
format(stringsizeof(string), "%s"veehName[GetVehicleModel(pvehicleid[playerid])-400]);
        
PlayerTextDrawSetString(playeridNomeVehicle[playerid], string);
        
PlayerTextDrawSetString(playeridTextaviao11[playerid], string);

        
SendClientMessage(playeridCOLOR_LIGHTBLUE"» Vocк pode ver alguns comandos do veiculo digitando {FFFFFF}/ajudaveh");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"» Para ligar ou desligar o veiculo, aperte a tecla {FFFFFF}Y {33CCFF}do seu teclado.");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"» Use {FFFFFF}/CAMERA {33CCFF}dentro do carro para ligar a camera em primeira pessoa!");
        new 
meuid GetOwnedVehicleID(playerid);
          if (
meuid == GetPlayerVehicleID(playerid))
        {
            
SendClientMessage(playerid0xF4FC00FF"» Use {FFFFFF}/menuvei{F4FC00} ou use {FFFFFF}N {F4FC00}Para Acessar o Painel de seu Veнculo!");
        }
        new 
newcar GetPlayerVehicleID(playerid);
        new 
oldcar gLastCar[playerid];
        new 
HouseCar PlayerInfo[playerid][pPHouseCarKey];

            if(
IsABombCar(newcar))
        {
            if(
TendoGuerra)
            {
                
SetPlayerTeam(playeridGetPlayerOrg(playerid));
            }
           }

        if(
PlayerKarting[playerid] != 0)
        {
            new 
kart GetVehicleModel(GetPlayerVehicleID(playerid));
            if(
kart==571)
            {
                
PlayerInKart[playerid] = 1;
                
KartingPlayers ++;
            }
        }

        if(
oldcar != 301)
        {
            if((
HouseCar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != HouseCar))
            {
                if(
gLastDriver[oldcar] == playerid && oldcar != newcar)
                {
                    
gLastDriver[oldcar] = 300;
                    
VTrancado[oldcar] = 0;
                    
UnLockCar(oldcar);
                }
            }
        }
        
gLastCar[playerid] = newcar;
        
gLastDriver[newcar] = playerid;
    }
    if(
newstate == PLAYER_STATE_SPAWNED && logouagora[playerid] ==)
    {
        if(
sincronizando[playerid] == 1)
        {
            return 
true;
        }
        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
        
{
            if(
sincronizando[playerid] == 1)
            {
                return 
true;
            }
            
SetPlayerSpawn(playerid);
        }
        
gPlayerSpawned[playerid] = 1;
        
SafeTime[playerid] = 60;
    }
    return 
true;
}

BPS::CheckVehicle(playeridvehicleid)
{
    if(
GetPlayerVehicleID(playerid) == vehicleid &&
    
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        
SetPlayerPos(playeridxyz+2.0);
    }
    return 
true;
}

BPS::HireCost(carid)
{
    switch (
carid)
    {
        case 
69:
        {
            return 
90000//Ford-GT
        
}
        case 
70:
        {
            return 
130000//infernus
        
}
        case 
71:
        {
            return 
100000//Diablo
        
}
        case 
72:
        {
            return 
80000;
        }
        case 
73:
        {
            return 
70000;
        }
        case 
74:
        {
            return 
60000;
        }
    }
    return 
0;
}

BPS::CarCheck()//ATUAL
{
    foreach(
Playerj)
    {
            new 
Float:health;
            
GetPlayerHealth(jhealth);
            if(
PlayerInfo[j][pDoenca]==1)
            {
                
GetPlayerHealth(jhealth);
                
SetPlayerHealth(jhealth 4.0);
                
SendClientMessage(jCOLOR_LIGHTBLUE"* Perdeu 4 de Saъde por DST - Vб atй um hospital ou procure um mйdico para se curar");
            }
            else if(
PlayerInfo[j][pDoenca]==2)
            {
                
GetPlayerHealth(jhealth);
                
SetPlayerHealth(jhealth 8.0);
                
SendClientMessage(jCOLOR_LIGHTBLUE"* Perdeu 8 de Saъde por DST - Vб atй um hospital ou procure um mйdico para se curar");
            }
            else if(
PlayerInfo[j][pDoenca]==3)
            {
                
GetPlayerHealth(jhealth);
                
SetPlayerHealth(jhealth 12.0);
                
SendClientMessage(jCOLOR_LIGHTBLUE"* Perdeu 12 de Saъde por DST - Vб atй um hospital ou procure um mйdico para se curar");
            }
            else if(
PlayerInfo[j][pDoenca]==4)
            {
                
GetPlayerHealth(jhealth);
                
SetPlayerHealth(jhealth 5.0);
                
SendClientMessage(jCOLOR_LIGHTBLUE"* Perdeu 5 de Saъde por Cirrose - Vб atй um hospital ou procure um mйdico para se curar.");
            }
            else if(
PlayerInfo[j][pDoenca]==5)
            {
                
GetPlayerHealth(jhealth);
                
SetPlayerHealth(jhealth 5.0);
                
SendClientMessage(jCOLOR_LIGHTBLUE"* Perdeu 5 de Saъde por Cвncer de Pulmгo - Vб atй um hospital ou procure um mйdico para se curar.");
            }
            if(
GetPlayerMoney(j) < 0)
            {
                if(
MoneyMessage[j]==0)
                {
                    new 
gstring[128];
                    
format(gstringsizeof(gstring), "Vocк esta devendo: R$%d Se nгo tiver essa grana vocк serб preso no proximo payday"GetPlayerMoney(j));
                    
SendClientMessage(jCOLOR_LIGHTREDgstring);
                    
MoneyMessage[j] = 1;
                }
            }
            else
            {
                
MoneyMessage[j] = 0;
            }
    }
    for(new 
1254c++)
    {
         if (
gLastDriver[c] >= 300)
        {
            
gLastDriver[c]++;
        }
        
//forndowner = -1;
    
}
    return 
true;
}

BPS::CarInit()
{
    for(new 
1254c++)
    {
         
gLastDriver[c] = 299;
    }
    
gLastDriver[301]=255;
    return 
true;
}

BPS::CarRespawn(carid)
{
    foreach(
Playeri)
    {
        if(
IsPlayerInVehicle(icarid) || HireCar[i] == carid)
        {
            
gLastDriver[carid] = 255;
            return 
0;
        }
    }
    
SetVehicleToRespawn(carid);
    
gLastDriver[carid] = 299;
    return 
true;

Reply
#4

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Reply
#5

? como assim
Reply
#6

Sem double..

@topic
Essa parte que vocк mandou nгo tem o codigo que precisamos..
Deve estar em OnPlayerEnterVehicle.. ou procure a parte que remove o player quando o mesmo nгo tem habilitaзгo
Reply
#7

mais antes tinha acho q tirei mais me ajuda pfv
Reply


Forum Jump:


Users browsing this thread: