[Ajuda] Veiculos pra profissгo
#8

Fiz assim

PHP код:
new Eveiculo[5];
new 
Emotoboy[4]; 
PHP код:
public OnGameModeInit()
{
    
UsePlayerPedAnims(); // Andar normalmente
    
Eveiculo[0] = AddStaticVehicle(578,-148.1839,-322.7406,2.0453,180.2084,1,1); // v1
    
Eveiculo[1] = AddStaticVehicle(578,-141.2557,-322.8502,2.0457,178.6352,1,1); // v2
    
Eveiculo[2] = AddStaticVehicle(578,-133.7400,-322.4712,2.0464,180.6215,1,1); // v3
    
Eveiculo[3] = AddStaticVehicle(578,-125.7944,-322.5229,2.0460,178.9929,1,1); // v4
    
Eveiculo[4] = AddStaticVehicle(578,-116.7708,-322.5246,2.0518,177.9242,1,1); // v5
    // --
    
Emotoboy[0] = AddStaticVehicle(448,2097.9995,-1812.6289,12.9820,90.5790,3,6); // pizza1
    
Emotoboy[1] = AddStaticVehicle(448,2097.5234,-1814.4313,12.9817,89.5149,3,6); // pizza2
    
Emotoboy[2] = AddStaticVehicle(448,2097.7832,-1801.9897,12.9825,91.2709,3,6); // pizza3
    
Emotoboy[3] = AddStaticVehicle(448,2098.0776,-1800.4216,12.9854,91.9463,3,6); // pizza4
    
return 1;

PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{    
    new 
arquivo[40], name[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnamesizeof(name)); 
    
format(arquivosizeof(arquivo),"Contas/%sInfos.ini"name); 
    
    
Player[playerid][pEmprego] = DOF2_GetInt(arquivo"Emprego");
    
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
isizeof(Eveiculo); i++)
        {
            if(
GetPlayerVehicleID(playerid) == Eveiculo[i])
            {
                if(
Player[playerid][pEmprego] == 1)
                {
                    
SendClientMessage(playerid, -1"[CLS]Digite /t para comeзar a trabalhar");
                }else{
                    
                    
SendClientMessage(playerid, -1"[CLS]Esse veнculo й apenas para Caminhoneiros");
                    
RemovePlayerFromVehicle(playerid);
                }
            }
        }
        for(new 
psizeof(Emotoboy); p++)
        {
            if(
GetPlayerVehicleID(playerid) == Emotoboy[p])
            {
                if(
Player[playerid][pEmprego] != 2)
                {
                    
SendClientMessage(playerid, -1"[CLS]Esse veнculo й apenas para MotoBoys");
                    
RemovePlayerFromVehicle(playerid);
                    
ClearAnimations(playerid);
                }else{
                    
SendClientMessage(playerid, -1"[CLS]Digite /t para comeзar a trabalhar");
                }
            }
        }
    }
    return 
1;

Ficou grande e eu acho que estou desperdiзando espaзo. Mas estб funcionado.
Reply


Messages In This Thread
Veiculos pra profissгo - by Cauezin - 24.04.2018, 15:35
Re: Veiculos pra profissгo - by tonisantolia - 24.04.2018, 15:44
Re: Veiculos pra profissгo - by Cauezin - 24.04.2018, 15:52
Re: Veiculos pra profissгo - by 1sbedx - 24.04.2018, 16:08
Re: Veiculos pra profissгo - by Cauezin - 24.04.2018, 16:21
Re: Veiculos pra profissгo - by Cauezin - 24.04.2018, 17:29
Re: Veiculos pra profissгo - by FerrariL - 24.04.2018, 17:32
Re: Veiculos pra profissгo - by Cauezin - 24.04.2018, 17:51
Re: Veiculos pra profissгo - by FerrariL - 24.04.2018, 17:53
Re: Veiculos pra profissгo - by Cauezin - 24.04.2018, 17:55
Re: Veiculos pra profissгo - by AutoMatic2 - 24.04.2018, 18:10
Re: Veiculos pra profissгo - by Cauezin - 24.04.2018, 19:54
Re: Veiculos pra profissгo - by Cleyson - 25.04.2018, 01:55
Re: Veiculos pra profissгo - by Cauezin - 25.04.2018, 18:49

Forum Jump:


Users browsing this thread: 1 Guest(s)