[Ajuda] Restringir carro - orgs '-'
#1

Eu criei uma org no meu gm e ela ta toda certa , mas acontece que os carros qualquer uma pode pegar =s

Aqui vгo os Codigos

pawn Код:
new MLcars[15];
pawn Код:
MLcars[0] = CreateVehicle(596,-95.6788, -1555.4833, 2.2300, -52.0000,0,0,999999999);
    MLcars[1] = CreateVehicle(596,-93.5744, -1558.2927, 2.2300, -52.0000,0,0,999999999);
    MLcars[2] = CreateVehicle(427,-98.7248, -1591.4651, 2.2300, -55.0000,0,0,999999999);
    MLcars[3] = CreateVehicle(427,-101.6354, -1585.8706, 2.6920, -55.0000,0,0,999999999);
    MLcars[4] = CreateVehicle(599,-76.6002, -1580.3295, 2.6920, -113.0000,0,0,999999999);
    MLcars[5] = CreateVehicle(599,-73.5477, -1577.8221, 2.6920, -113.0000,0,0,999999999);
    MLcars[6] = CreateVehicle(581,-72.2342, -1575.5786, 2.6920, -113.0000,0,0,999999999);
    MLcars[7] = CreateVehicle(581,-70.8378, -1574.3118, 2.6920, -113.0000,0,0,999999999);
    MLcars[8] = CreateVehicle(601,-69.5559, -1553.4609, 2.6920, -184.0000,0,0,999999999);
    MLcars[9] = CreateVehicle(580,-58.6222, -1565.9410, 2.2300, -184.0000,0,0,999999999);
    MLcars[10] = CreateVehicle(482,-61.7763, -1562.1857, 2.5600, -184.0000,0,0,999999999);
    MLcars[11] = CreateVehicle(490,-90.3683, -1560.5863, 2.5600, -47.0000,0,0,999999999);
    MLcars[12] = CreateVehicle(490,-84.0720, -1547.8733, 2.5600, -171.0000,0,0,999999999);
        MLcars[13] = CreateVehicle(470,-95.4170, -1595.2449, 2.6920, -62.0000,0,0,999999999);
    MLcars[14] = CreateVehicle(528,-92.7300, -1580.2351, 2.6920, -136.0000,0,0,999999999);
pawn Код:
if(vid==MLcars[0]||vid==MLcars[1]||vid==MLcars[2]||vid==MLcars[3]||vid==MLcars[4]||vid==MLcars[5]||vid==MLcars[6]||vid==MLcars[7]||vid==MLcars[8]||vid==MLcars[9]||vid==MLcars[10]||vid==MLcars[11]||vid==MLcars[12]||vid==MLcars[13]||vid==MLcars[14])
        {
            if(PlayerInfo[playerid][pMember] == 30||PlayerInfo[playerid][pLeader] == 30) { }
            else if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pMember] == 14||PlayerInfo[playerid][pMember] == 21)
            {
            RemovePlayerFromVehicle(playerid);
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "{FF3D3D}[Erro]{FFFFFF} Vocк nгo й um Federal.");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
            }
        }
Tipo nгo da nenhum erro nem Waring ... mas eles nao ficam restringidos ... pq ?
Reply
#2

Primeiro adicione essa stock no seu GM
PHP код:
public IsAMLVehicle(vehicleid)
{
    for(new 
0sizeof(MLcars); ++i) {
        if(
vehicleid == MLcars[i])    return 1;
    }
    return 
0;

E troque a funзгo por esta aqui:
PHP код:
if(IsAMLVehicle(vid))
        {
            if(
PlayerInfo[playerid][pMember] == 30||PlayerInfo[playerid][pLeader] == 30) { }
            else if(
PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pMember] == 14||PlayerInfo[playerid][pMember] == 21)
            {
            
RemovePlayerFromVehicle(playerid);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"{FF3D3D}[Erro]{FFFFFF} Vocк nгo й um Federal.");
                
RemovePlayerFromVehicle(playerid);
                
TogglePlayerControllable(playerid1);
            }
        } 
E faзa o teste.
Reply
#3

Nem pegou =s continua dando pra pegar o carro de boa como se nao fosse de org
Reply
#4

pawn Код:
if(vid==MLcars[0]||vid==MLcars[1]||vid==MLcars[2]||vid==MLcars[3]||vid==MLcars[4]||vid==MLcars[5]||vid==MLcars[6]||vid==MLcars[7]||vid==MLcars[8]||vid==MLcars[9]||vid==MLcars[10]||vid==MLcars[11]||vid==MLcars[12]||vid==MLcars[13]||vid==MLcars[14])
{
    if(PlayerInfo[playerid][pMember] == 30||PlayerInfo[playerid][pLeader] == 30)
    {
    }
    else
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_RED, "{FF3D3D}[Erro]{FFFFFF} Vocк nгo й um Federal.");
        TogglePlayerControllable(playerid, 1);
    }
}
e verifique se existe esta linha.

pawn Код:
new vid = GetPlayerVehicleID(playerid);
Reply
#5

Quote:
Originally Posted by Macintosh
Посмотреть сообщение
e verifique se existe esta linha.

pawn Код:
new vid = GetPlayerVehicleID(playerid);
Tem :
pawn Код:
new vid = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
               RemovePlayerFromVehicle(playerid);
               SetTimerEx("Saircarro", 2000, 0, "i", playerid);
        }
        else if(vid==AluguelCar[0]||vid==AluguelCar[1]||vid==AluguelCar[2]||vid==AluguelCar[3]||vid==AluguelCar[4]||vid==AluguelCar[5]||vid==AluguelCar[6]||vid==AluguelCar[7]||vid==AluguelCar[8]||vid==AluguelCar[9])
        {
            TogglePlayerControllable(playerid, 1);
            RemovePlayerFromVehicle(playerid);
        }
pawn Код:
new vid = GetPlayerVehicleID(playerid);
    if(GasMission[playerid] == 2 && vid >= CaminhaoPosto[0] && vid <= CaminhaoPosto[2]) // MISSГO FINALIZADA.
    {
        if(GetVehicleTrailer(GetPlayerVehicleID(playerid)))
        {
            SendClientMessage(playerid, COLOR_YELLOW2, "[Missгo de Camioneiro]");
            SendClientMessage(playerid, COLOR_PURPLE, "Abastecendo Posto...");
            TogglePlayerControllable(playerid, false);
            SetTimerEx("TirarCargaCaminhao", 3000, 0,"e",playerid);
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "{FF3D3D}[Erro]{FFFFFF} Onde estб a sua carga?");
        }
    }
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        new newcar = GetVehicleModel(GetPlayerVehicleID(playerid));
        new oldcar = gLastCar[playerid];
        new vId = GetPlayerVehicleID(playerid);
        new housecar = PlayerInfo[playerid][pPhousekey]+2;
        for(new i=0;i<MAX_PLAYERS;i++)
        TelePos[playerid][0] = 0.0;
        TelePos[playerid][1] = 0.0;
        new pName[256];
        GetPlayerName(playerid, pName, sizeof(pName));
pawn Код:
new vid = GetPlayerVehicleID(playerid);
        if(vid==Alqaedacars[0]||vid==Alqaedacars[1]||vid==Alqaedacars[2]||vid==Alqaedacars[3]||vid==Alqaedacars[4]||vid==Alqaedacars[5]||vid==Alqaedacars[6]||vid==Alqaedacars[7]||vid==Alqaedacars[8]||vid==Alqaedacars[9])
        {
            if(PlayerInfo[playerid][pMember] == 22||PlayerInfo[playerid][pLeader] == 22) { }
            else
            {
                SendClientMessage(playerid,COLOR_RED,"{FF3D3D}[Erro]{FFFFFF} Vocк nгo й da Alqaeda.");
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
            }
        }
pawn Код:
if(IsPlayerConnected(playerid))
        {
            new vid = GetPlayerVehicleID(playerid);
            if(vid==AluguelCar[0]||vid==AluguelCar[1]||vid==AluguelCar[2]||vid==AluguelCar[3]||vid==AluguelCar[4]||vid==AluguelCar[5]||vid==AluguelCar[6]||vid==AluguelCar[7]||vid==AluguelCar[8]||vid==AluguelCar[9])
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if(vid==AluguelCar[0]||vid==AluguelCar[1]||vid==AluguelCar[2])
                {
esses ai
Reply
#6

Topo
pawn Код:
new Novoscarros[0]; // Numero de carros
pawn Код:
//Novos carros//
Novoscarros[0]=CreateVehicle(432,420.0421,2442.5952,16.5105,90.2622,3,3,900000); //
pawn Код:
for(new i = 0; i < sizeof(Novoscarros); i ++)
        {
            if(vId==Novoscarros[i])
            {
                if(GetPlayerOrg(playerid) != TEAM_SUAORG)
                {
                    SendClientMessage(playerid,SUACOR,"[Erro] Vocк nгo й da SUA ORG );
                    RemovePlayerFromVehicle(playerid);
                    Descongelar(playerid);
                }
            }
        }
Reply
#7

Quote:
Originally Posted by Sampizito
Посмотреть сообщение
Topo
pawn Код:
new Novoscarros[0]; // Numero de carros
pawn Код:
//Novos carros//
Novoscarros[0]=CreateVehicle(432,420.0421,2442.5952,16.5105,90.2622,3,3,900000); //
pawn Код:
for(new i = 0; i < sizeof(Novoscarros); i ++)
        {
            if(vId==Novoscarros[i])
            {
                if(GetPlayerOrg(playerid) != TEAM_SUAORG)
                {
                    SendClientMessage(playerid,SUACOR,"[Erro] Vocк nгo й da SUA ORG );
                    RemovePlayerFromVehicle(playerid);
                    Descongelar(playerid);
                }
            }
        }
ops
pawn Код:
new vId = GetPlayerVehicleID(playerid);
Reply
#8

paulor e Sampizito
Deu esses erros ai :

pawn Код:
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22137) : error 017: undefined symbol "GetPlayerOrg"
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22139) : error 037: invalid string (possibly non-terminated string)
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22139) : error 029: invalid expression, assumed zero
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22139) : error 017: undefined symbol "Erro"
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22139) : fatal error 107: too many error messages on one line
Linhas:

pawn Код:
for(new i = 0; i < sizeof(MLcars); i ++)
        {
            if(vId==MLcars[i])
            {
                if(GetPlayerOrg(playerid) != 30)
                {
                    SendClientMessage(playerid,COLOR_RED,"[Erro] Vocк nгo й da Milicia);
                    RemovePlayerFromVehicle(playerid);
                    Descongelar(playerid);
                }
            }
        }
E assim :

pawn Код:
new vId = GetPlayerVehicleID(playerid);
for(new i = 0; i < sizeof(MLcars); i ++)
        {
            if(vId==MLcars[i])
            {
                if(GetPlayerOrg(playerid) != 30)
                {
                    SendClientMessage(playerid,COLOR_RED,"[Erro] Vocк nгo й da Milicia);
                    RemovePlayerFromVehicle(playerid);
                    Descongelar(playerid);
                }
            }
        }
Dб esses erros

pawn Код:
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(4640) : warning 202: number of arguments does not match definition
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22133) : error 021: symbol already defined: "vId"
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22138) : error 017: undefined symbol "GetPlayerOrg"
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22140) : error 037: invalid string (possibly non-terminated string)
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22140) : error 029: invalid expression, assumed zero
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22140) : error 017: undefined symbol "Erro"
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22140) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Reply
#9

pawn Код:
for(new i = 0; i < sizeof(MLcars); i ++)
{
           if(vId==MLcars[i])
            {
                if(GetPlayerOrg(playerid) != 30)
                {
                    SendClientMessage(playerid,COLOR_RED,"[Erro] Vocк nгo й da Milicia");
                    RemovePlayerFromVehicle(playerid);
                    TogglePlayerControllable(playerid,1);
                }
            }
        }
Troca por esse /\
E o erro do vId й porque jб tem mais que um definido, apague todos deixando somente 1 na public
Reply
#10

Quote:
Originally Posted by humildadeforever
Посмотреть сообщение
pawn Код:
for(new i = 0; i < sizeof(MLcars); i ++)
{
           if(vId==MLcars[i])
            {
                if(GetPlayerOrg(playerid) != 30)
                {
                    SendClientMessage(playerid,COLOR_RED,"[Erro] Vocк nгo й da Milicia");
                    RemovePlayerFromVehicle(playerid);
                    TogglePlayerControllable(playerid,1);
                }
            }
        }
Troca por esse /\
E o erro do vId й porque jб tem mais que um definido, apague todos deixando somente 1 na public
Deu esses erros :
pawn Код:
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(22169) : error 017: undefined symbol "GetPlayerOrg"
C:\Users\Alfredo\Desktop\BPP GM\BVL\gamemodes\BrasilSamp.pwn(59849) : warning 225: unreachable code
Reply


Forum Jump:


Users browsing this thread: