[AJUDA] Restringir veнculos a uma certa skin
#1

Fala galera, no meu GM, tenho vбrias classes para serem escolhidas
pawn Code:
AddPlayerClass(6,1368.4499511719,730.72943115234,10.477864265442,337.2402,0,0,0,0,0,0); //caminhoneiro
    AddPlayerClass(5,1368.4499511719,730.72943115234,10.477864265442,337.2402,0,0,0,0,0,0); //caminhoneiro
    AddPlayerClass(261,1368.4499511719,730.72943115234,10.477864265442,337.2402,0,0,0,0,0,0); //caminhoneiro
    AddPlayerClass(262,1368.4499511719,730.72943115234,10.477864265442,337.2402,0,0,0,0,0,0); //caminhoneiro
    AddPlayerClass(163,-2262.3386230469,2330.1884765625,4.6996827125549,337.2402,0,0,0,0,0,0); //onibus
    AddPlayerClass(164,-2262.3386230469,2330.1884765625,4.6996827125549,337.2402,0,0,0,0,0,0); //onibus
    AddPlayerClass(165,-2262.3386230469,2330.1884765625,4.6996827125549,337.2402,0,0,0,0,0,0); //onibus
    AddPlayerClass(166,-2262.3386230469,2330.1884765625,4.6996827125549,337.2402,0,0,0,0,0,0); //onibus
    AddPlayerClass(280,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //policial
    AddPlayerClass(281,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //policial
    AddPlayerClass(282,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //policial
    AddPlayerClass(283,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //policial
    AddPlayerClass(100,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //motoqueiro
    AddPlayerClass(247,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //motoqueiro
    AddPlayerClass(248,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //motoqueiro
    AddPlayerClass(254,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //motoqueiro
    AddPlayerClass(277,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //bombeiro
    AddPlayerClass(278,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //bombeiro
    AddPlayerClass(279,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //bombeiro
    AddPlayerClass(274,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //paramedico
    AddPlayerClass(275,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //paramedico
    AddPlayerClass(276,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //paramedico
    AddPlayerClass(50,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //mecanico
    AddPlayerClass(72,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //hippie
    AddPlayerClass(73,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //hippie
    AddPlayerClass(61,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //piloto de aviao
    AddPlayerClass(51,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //mountain bike
    AddPlayerClass(52,1106.3195,-1413.4640,13.5941,337.2402,0,0,0,0,0,0); //mountain bike
Eu queria saber o que faзo para restringir os caminhхes para a as skins 6/5/261/262 e todas as outras com seus respectivos veнculos, sу quero o Code, o ID dos veнculos e skins eu mudo sozinho. Alguйm pode me ajudar?
Reply
#2

GetPlayerSkin + OnPlayerEnterVehicle( ou OnPlayerStateChange)
Reply
#3

Desculpa mas sou muito novato em script e sу falar GetPlayerSkin eu nгo entendo =(

[EDIT] Quero o code eu nгo sei por onde comeзar =/
Reply
#4

pawn Code:
new MinhaSkin = GetPlayerSkin(playerid);
if(MinhaSkin != 5 && MinhaSkin  != 6 && MinhaSkin != 261 && MinhaSkin != 262)
    return SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas");
Use isto juntamente com as outras funзхes
Reply
#5

Coloquei assim e nгo estб funcionando
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new MinhaSkin = GetPlayerSkin(playerid);
    if(MinhaSkin != 5 && MinhaSkin  != 6 && MinhaSkin != 261 && MinhaSkin != 262)
    SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas");
    return 1;
}
Reply
#6

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new vehicleid = GetPlayerVehicleID(playerid):
    if(vehicleid == (id dos caminhoes)
    {
       new MinhaSkin = GetPlayerSkin(playerid);
       if(MinhaSkin != 5 && MinhaSkin  != 6 && MinhaSkin != 261 && MinhaSkin != 262)
       {
        SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas");
        RemovePlayerFromVehicle(playerid);
       }
    }
  return 1;
}
Reply
#7

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new MinhaSkin = GetPlayerSkin(playerid);
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 520) // Coloque o modelo do caminhгo
    {
        if(MinhaSkin != 5 && MinhaSkin  != 6 && MinhaSkin != 261 && MinhaSkin != 262)
        {
            SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas");
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, true);
        }
    }
    return 1;
}
Reply
#8

pawn Code:
C:\Users\Eduardo\Documents\SAMP Server\gamemodes\FreeRoam.pwn(548) : error 017: undefined symbol "id"
C:\Users\Eduardo\Documents\SAMP Server\gamemodes\FreeRoam.pwn(548) : error 017: undefined symbol "caminhoes"
C:\Users\Eduardo\Documents\SAMP Server\gamemodes\FreeRoam.pwn(548) : error 029: invalid expression, assumed zero
C:\Users\Eduardo\Documents\SAMP Server\gamemodes\FreeRoam.pwn(548) : fatal error 107: too many error messages on one line

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


4 Errors.
EDIT ERRO NO CODE DO KINKX
Reply
#9

vc tem q mudar os modelos dos caminhoes, colocando os ids
Reply
#10

Viniborn, e pra colocar vбrios caminhoes? Os ID 403, 514,515
Reply
#11

Segue o exemplo das skin...

pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new MinhaSkin = GetPlayerSkin(playerid);
    new Veiculo = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(Veiculo == 403 || Veiculo == 514 || Veiculo == 515) // Coloque o modelo do caminhгo
    {
        if(MinhaSkin != 5 && MinhaSkin  != 6 && MinhaSkin != 261 && MinhaSkin != 262)
        {
            SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas");
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, true);
        }
    }
    return 1;
}
Reply
#12

@edit: dexa, ele ja concertou
Reply
#13

Esse code faz com que as skins 5/6/261/262 sejam proibidas, nгo? Eu quero que todas sejam proibidas menos essas 4
Reply
#14

Eh exatamente o que diz no codigo, "!" significa, diferente de, entгo todas as skins menos essas ai voa poder usar
Reply
#15

Ahh entendi, e pra eu colocar restriзхes de outras skins a outros veiculos? Por exemplo no comeзo da thread eu disse que tinha varias classes, pra eu restringir elas pras respectivas skins como eu procedo?
Reply
#16

segue o exemplo

pawn Code:
new MinhaSkin = GetPlayerSkin(playerid);
    new Veiculo = GetVehicleModel(GetPlayerVehicleID(playerid));
    if(Veiculo == 403 || Veiculo == 514 || Veiculo == 515) // COLOQUE AKI OS MODELOS DE CARROS RESTRINGINDOS PARA CERTAS SKINS
    {
        if(MinhaSkin != 5 && MinhaSkin  != 6 && MinhaSkin != 261 && MinhaSkin != 262) // COLOQUE AKI AS SKINS QUE POSSAM USAR OS CARROS CITADOS ACIMA
        {
            SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas"); // MUDA PARA A MENSGEAGEM Q VC QUISER
            RemovePlayerFromVehicle(playerid);
            TogglePlayerControllable(playerid, true);
        }
    }
    return 1;
pawn Code:
if(Veiculo == 403 || Veiculo == 514 || Veiculo == 515)
aki sao os modelos do veiculo, que vocк ira trocar para que apenas alguma skins possam ser usadas

pawn Code:
if(MinhaSkin != 5 && MinhaSkin  != 6 && MinhaSkin != 261 && MinhaSkin != 262)
aki sгo as skins que soh poderao usar os veiculos acima, й soh trocar os ids
Reply
#17

Mas tipo, vc nгo entendeu, eu estou dizendo assim, sгo classes, se a skin 0 for da classe caminhoneira, e o caminhгo for id 0 por exemplo, a skin 1 que й da classe onibus nгo poderб usar o carro 0, sу o 1 (exemplo) e o 0 nгo poderб usar o 1, entendeu? como se fossem times
Reply
#18

mas й o que didz no codigo acima ue '.'

se o palyer tiver skin 0 , e o caminhao for id 0 , ela poderб entrar
se o player tiver outra skin, nao podera entrar
Reply
#19

Entгo й sу eu repetir isso vбrias vezes?
pawn Code:
if(Veiculo == 403 || Veiculo == 514 || Veiculo == 515) // Coloque os modelos
{
if(MinhaSkin != 5 && MinhaSkin != 6 && MinhaSkin != 261 && MinhaSkin != 262)
{
SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, true);
}
if(Veiculo == 555 || Veiculo == 556 || Veiculo == 557) // Coloque os modelos
{
if(MinhaSkin != 0 && MinhaSkin != 1 && MinhaSkin != 2)
{
SendClientMessage(playerid,-1,"Vocк nгo tem as skins permitidas");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, true);
}
Reply
#20

nao precisa repetir EXATAMENTE tudo, vocк tera qe colocar todos os idґs,
Mas o cуdigo, vc pode optimizar
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)