[Pedido] Nгo poder entrar no veiculo se nгo for da org
#1

PHP Code:
new VCV[11];  //O CV TEM CARROS 
PHP Code:
VCV[0] = CreateVehicle(567,2166.9192,-1808.8960,13.2744,1.8027,3,3,60000); // carro CV 6                 
    
VCV[1] = CreateVehicle(480,2162.8418,-1808.9608,13.1587,355.8469,3,3,60000); // carro CV 7               
    
VCV[2] = CreateVehicle(533,2170.3511,-1808.2281,13.0954,356.7516,3,3,60000); // carro CV 8               
    
VCV[3] = CreateVehicle(487,2140.4653,-1811.3521,18.8720,359.0771,3,3,60000); // heli CV                  
    
VCV[4] = CreateVehicle(581,2152.4373,-1791.9607,13.0896,265.8248,3,3,60000); // moto CV 1                 
    
VCV[5] = CreateVehicle(581,2152.4802,-1794.4839,13.1161,271.8142,3,3,60000); // moto CV 2                 
    
VCV[6] = CreateVehicle(560,2170.0002,-1793.9656,13.1749,178.4637,3,3,60000); // carro CV 2               
    
VCV[7] = CreateVehicle(560,2159.1633,-1808.6270,13.0691,359.6226,3,3,60000); // carro CV 3               
    
VCV[8] = CreateVehicle(559,2161.1936,-1793.8085,13.0271,178.9899,3,3,60000); // carro CV 4               
    
VCV[9] = CreateVehicle(562,2165.2068,-1793.7007,13.0222,177.9311,3,3,60000); // carro CV 5               
    
VCV[10] = CreateVehicle(424,2173.9265,-1808.1708,13.1515,0.4743,3,3,60000); // carro CV 1 
PHP Code:
,
stock GetOrgName(orgid)
{
    new 
str[30];
    if(
orgid == 0)
    {
        
str "Civil";
    }
    if(
orgid == 1)
    {
        
str "Comando Vermelho";
    }
    if(
orgid == 2)
    {
        
str "P.C.C";
    }
    if(
orgid == 3)
    {
        
str "Ballas";
    }
    if(
orgid == 4)
    {
        
str "Groove Street";
    }
    if(
orgid == 5)
    {
        
str "Los Vagos";
    }
    return 
str;

Reply
#2

Nгo sei se vocк quer algo do tipo, mas vamos lб.

Pode ser feito de duas maneiras:

1

PHP Code:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(
vehicleid == || vehicleid == || vehicleid == 3)
    {
        if(
PlayerData[playerid][pOrg] != ORG_POLICIAL)
        {
            new 
Float:cPos[3];
            
            
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
            
SetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
            
SendClientMessage(playerid, -1"Esse veнculo й da org de Policial.");
        }
    }
    return 
1;

2

PHP Code:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    for(new 
1!= 3; ++i)
    {
        if(
vehicleid == i)
        {
            if(
PlayerData[playerid][pOrg] != ORG_POLICIAL)
            {
                new 
Float:cPos[3];

                
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
                
SetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
                
SendClientMessage(playerid, -1"Esse veнculo й da org de Policial.");
            }
        }
    }
    return 
1;

Reply
#3

PHP Code:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
i!= sizeof(VCV); ++i)
        {
            if(
GetPlayerVehicleID(playerid) == VCV[i])
            {
                if(
Player[playerid][Org] != ComandoVermelho)
                {
                    
ClearAnimations(playerid);
                    
SendClientMessage(playeridVermelho"| ERRO | Este veнculo estб reservado apenas para os membros do Comando Vermelho!");
                    break;
                }
            }
        }
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by AutoMatic2
View Post
PHP Code:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        for(new 
i!= sizeof(VCV); ++i)
        {
            if(
GetPlayerVehicleID(playerid) == VCV[i])
            {
                if(
Player[playerid][Org] != ComandoVermelho)
                {
                    
ClearAnimations(playerid);
                    
SendClientMessage(playeridVermelho"| ERRO | Este veнculo estб reservado apenas para os membros do Comando Vermelho!");
                    break;
                }
            }
        }
    }
    return 
1;

:\Users\LEONARDO\Desktop\BFF\gamemodes\BPF.pwn(722 ) : error 017: undefined symbol "ComandoVermelho"
Reply
#5

Quote:
Originally Posted by GuiKommander
View Post
Nгo sei se vocк quer algo do tipo, mas vamos lб.

Pode ser feito de duas maneiras:

1

PHP Code:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(
vehicleid == || vehicleid == || vehicleid == 3)
    {
        if(
PlayerData[playerid][pOrg] != ORG_POLICIAL)
        {
            new 
Float:cPos[3];
            
            
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
            
SetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
            
SendClientMessage(playerid, -1"Esse veнculo й da org de Policial.");
        }
    }
    return 
1;

2

PHP Code:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    for(new 
1!= 3; ++i)
    {
        if(
vehicleid == i)
        {
            if(
PlayerData[playerid][pOrg] != ORG_POLICIAL)
            {
                new 
Float:cPos[3];
                
GetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
                
SetPlayerPos(playeridcPos[0], cPos[1], cPos[2]);
                
SendClientMessage(playerid, -1"Esse veнculo й da org de Policial.");
            }
        }
    }
    return 
1;

:\Users\LEONARDO\Desktop\BFF\gamemodes\BPF.pwn(722 ) : error 017: undefined symbol "ORG_POLICIAL"
Reply
#6

Define as org..

#define ORG_POLICIAL 6
#define ORG_CV 1

enfim continua do 0 ao sla qnts org..
Reply
#7

Consegui, vlw galera
Reply
#8

https://sampforum.blast.hk/showthread.php?tid=301128

/\ Pode ser util para vocк aprender um pouco mais .
Reply
#9

Quote:
Originally Posted by Don_Speed
View Post
https://sampforum.blast.hk/showthread.php?tid=301128

/\ Pode ser util para vocк aprender um pouco mais .
Vlw , vou dar uma estudada
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)