SA-MP Forums Archive
[ AJUDA ] Carros ! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ AJUDA ] Carros ! (/showthread.php?tid=261237)



[ AJUDA ] Carros ! - Ghost_ - 12.06.2011

Ae galera , to fazendo uma nova Org , Sons Of Anarchy , e fui setar os veiculos pra ela , deem uma olhada nos codes:

pawn Код:
forward IsASonsCar(carid);

    if(IsASonsCar(vehicleid))
    {
        if(IsASons(playerid) || ispassenger) { }
        else
        {
            new Float:x,Float:y,Float:z,Float:a;
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,a);
            SetPlayerPos(playerid, x, y, z+0.3);
            SetPlayerFacingAngle(playerid, a);
            SendClientMessage(playerid, COR_SONS, "Vocк Nгo й da Sons Of Anarchy !");
        }
    }

public IsASonsCar(carid)
{
    if(carid >= 689 && carid <= 701)
    {
        return 1;
    }
    return 0;
}
Bom , era pra funcionar certinho , a contagem estб correta ao meu ver , olhe sу :

pawn Код:
AddStaticVehicleEx(542,1671.90454102,-1702.35534668,20.32777405,90.00000000,-1,-1,15); //Clover 688 - Ultimo carro do GameMode sem os veiculos dos Sons , Id 688 do GM

    //------------------------- HQ SONS OF ANARCHY -------------------------
    AddStaticVehicleEx(463,-60.69239044,-1161.33801270,1.36699998,149.75000000,43,1,60000); //Freeway 689
    AddStaticVehicleEx(463,-63.59852600,-1159.77307129,1.36699998,149.74914551,43,1,60000); //Freeway 690
    AddStaticVehicleEx(463,-66.19172668,-1158.36889648,1.36699998,149.74914551,43,1,60000); //Freeway 691
    AddStaticVehicleEx(463,-69.09605408,-1156.80187988,1.36699998,149.74914551,43,1,60000); //Freeway 692
    AddStaticVehicleEx(463,-71.84320068,-1155.31311035,1.36699998,149.74914551,43,1,60000); //Freeway 693
    AddStaticVehicleEx(463,-74.67872620,-1153.77709961,1.36699998,149.74914551,43,1,60000); //Freeway 694
    AddStaticVehicleEx(487,-74.66811371,-1172.87524414,5.93780231,337.00000000,43,43,60000); //Maverick 695
    AddStaticVehicleEx(586,-93.02802277,-1194.53564453,1.82970250,343.50000000,43,1,60000); //Wayfarer 696
    AddStaticVehicleEx(586,-89.96662140,-1195.37780762,1.82970250,343.49853516,43,1,60000); //Wayfarer 697
    AddStaticVehicleEx(586,-86.97744751,-1196.20166016,1.82970250,343.49853516,43,1,60000); //Wayfarer 698
    AddStaticVehicleEx(586,-84.03634644,-1197.01086426,1.82970250,343.49853516,43,1,60000); //Wayfarer 699
    AddStaticVehicleEx(586,-80.90316772,-1197.87561035,1.82970250,343.49853516,43,1,60000); //Wayfarer 700
    AddStaticVehicleEx(586,-77.81758118,-1198.72668457,1.82970250,343.49853516,43,1,60000); //Wayfarer 701
Os numeros ao lado do nome sao a ID na contagem do GM , na public IsASonsCar , estб correto ( ou nгo ? ._. ) Vai do 689 atй o 701 , sу que , sу os veiculos da ID 695 atй 698 ficaram exclusivos pros Sons , o resto , qualquer um entra normalmente sem ser da Sons Of Anarchy , o q tem de errado e por que nao estб todos esses exclusivos pros Sons Of Anarchy ?


Re: [ AJUDA ] Carros ! - EviL_Knight - 12.06.2011

Up Up Up


Re: [ AJUDA ] Carros ! - humildadeforever - 12.06.2011

Comeзo do GM.
pawn Код:
new SonsCars[7];
public OnGameModeInit()
pawn Код:
SonsCars[0] = AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2);
SonsCars[1] = AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2);
SonsCars[2] = AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2);
public OnPlayerStateChange(playerid, newstate, oldstate)
pawn Код:
new vid = GetPlayerVehicleID(playerid);
if(vid==SonsCars[0]||vid==SonsCars[1]||vid==SonsCars[2])
 {
   if(IsASons(playerid)
  {
  }
  else
 {
  SendClientMessage(playerid,COR_SONS,"Vocк nгo й da  Sons Of Anarchy");
  RemovePlayerFromVehicle(playerid);
  TogglePlayerControllable(playerid, 1);
  }
}



Re: [ AJUDA ] Carros ! - Ghost_ - 12.06.2011

Valeu cara , mas , eu queria continuar com o mesmo modo de setar carros pras Org's , alguem mais pode me ajudar a corrigir sem ser do jeito que o Humildade postou ?


Re: [ AJUDA ] Carros ! - Ricop522 - 12.06.2011

pawn Код:
public IsASonsCar(carid)
{
    new c = GetVehicleModel(carid);
    if(c == 463 || c == 486 || c == 586)
    {
        return 1;
    }
    return 0;
}



Re: [ AJUDA ] Carros ! - Ghost_ - 12.06.2011

Ricop , mas assim , todas as Freeway's e Wayfare's vao ficar sу pros Sons

E tem 2 Org's de Motoqueiros , dae nao tem como fazer sу pra Sons


Re: [ AJUDA ] Carros ! - Ricop522 - 12.06.2011

Vocк terб que dar /carid (pega cada id dentro do jogo) para fazer desse jeito, faзa do jeito que o humildade;


Re: [ AJUDA ] Carros ! - Ghost_ - 12.06.2011

/carid ? Aqui nгo tem esse CMD nгo O_O


Re: [ AJUDA ] Carros ! - Ghost_ - 12.06.2011

Alguem ?


Re: [ AJUDA ] Carros ! - Shadoww5 - 12.06.2011

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/carid"true) == 0)
    {
        if(
IsPlayerInAnyVehicle(playerid))
        {`
    
            new str[64];
            format(str, 64, "ID do veiculo: %d.",GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, -1, str);
        }
        else return SendClientMessage(playerid, -1, "Vocк nгo estб em nenhum veiculo.");
    }
    return 0;

Coloca este comando no seu GM e faz da forma que o Ricop522 falou.