[Ajuda] Fazendo Comando
#1

Olб pessoal do Forum-samp estou aqui com uma dъvida.

eu fiz esse comando :

pawn Код:
if (strcmp("/tunados2", cmdtext, true, 10) == 0)
    {
        new listitems[] = "Elegy\nSultan\nInfernus\nBullet";
        ShowPlayerDialog(playerid,222,DIALOG_STYLE_LIST,"Lista de Carros:",listitems,"Selecionar","Sair");
        return 1;
    }
E agora o que faзo?

eu to querendo que o cara escolha o Carro, e esse carro aparece na frente dele. mais ou menos assim:

pawn Код:
new Float:X,Float:Y,Float:Z,Float:Angle, carid;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,Angle);
    carid = GetPlayerVehicleID(playerid);
    carid = CreateVehicle(562,X,Y,Z,0.0,-1,-1,9000000);
    vehCriados[carid] = 1;
    LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
    AddVehicleComponent(carid,1163);
    AddVehicleComponent(carid,1036);
    AddVehicleComponent(carid,1038);
    AddVehicleComponent(carid,1049);
    AddVehicleComponent(carid,1040);
    AddVehicleComponent(carid,1038);
    AddVehicleComponent(carid,1147);
    AddVehicleComponent(carid,1010);
    AddVehicleComponent(carid,1079);
    ChangeVehiclePaintjob(carid,2);
    TogglePlayerControllable(playerid,true);
    }
Reply
#2

para aparecer na frente, lado onde desejar utilize as Floats , e incremente posiзхes a eles 2+X,50-Y.. assim vai

PHP код:
if (strcmp("/tunados2"cmdtexttrue10) == 0)
{
     new 
listitems[] = "Elegy\nSultan\nInfernus\nBullet";
     
ShowPlayerDialog(playerid,222,DIALOG_STYLE_LIST,"Lista de Carros:",listitems,"Selecionar","Sair");
     return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 222) {
        if(
response) {
            if(
listitem == 0) {
                new 
Float:X,Float:Y,Float:Z,Float:Anglecarid;
                
GetPlayerPos(playerid,X,Y,Z);
                
GetPlayerFacingAngle(playerid,Angle);
                
carid GetPlayerVehicleID(playerid);
                
carid CreateVehicle(ID DO CARRO ELEGY,X,Y,Z,0.0,-1,-1,9000000);
                
//vehCriados[carid] = 1;
                
LinkVehicleToInterior(caridGetPlayerInterior(playerid));
                
AddVehicleComponent(carid,1163);
                
AddVehicleComponent(carid,1036);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1049);
                
AddVehicleComponent(carid,1040);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1147);
                
AddVehicleComponent(carid,1010);
                
AddVehicleComponent(carid,1079);
                
ChangeVehiclePaintjob(carid,2);
                
TogglePlayerControllable(playerid,true);
            }
            if(
listitem == 1) {
                new 
Float:X,Float:Y,Float:Z,Float:Anglecarid;
                
GetPlayerPos(playerid,X,Y,Z);
                
GetPlayerFacingAngle(playerid,Angle);
                
carid GetPlayerVehicleID(playerid);
                
carid CreateVehicle(ID DO CARRO SULTAN,X,Y,Z,0.0,-1,-1,9000000);
                
//vehCriados[carid] = 1;
                
LinkVehicleToInterior(caridGetPlayerInterior(playerid));
                
AddVehicleComponent(carid,1163);
                
AddVehicleComponent(carid,1036);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1049);
                
AddVehicleComponent(carid,1040);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1147);
                
AddVehicleComponent(carid,1010);
                
AddVehicleComponent(carid,1079);
                
ChangeVehiclePaintjob(carid,2);
                
TogglePlayerControllable(playerid,true);
            }
            if(
listitem == 2) {
                new 
Float:X,Float:Y,Float:Z,Float:Anglecarid;
                
GetPlayerPos(playerid,X,Y,Z);
                
GetPlayerFacingAngle(playerid,Angle);
                
carid GetPlayerVehicleID(playerid);
                
carid CreateVehicle(ID DO INFERNUS,X,Y,Z,0.0,-1,-1,9000000);
                
//vehCriados[carid] = 1;
                
LinkVehicleToInterior(caridGetPlayerInterior(playerid));
                
AddVehicleComponent(carid,1163);
                
AddVehicleComponent(carid,1036);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1049);
                
AddVehicleComponent(carid,1040);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1147);
                
AddVehicleComponent(carid,1010);
                
AddVehicleComponent(carid,1079);
                
ChangeVehiclePaintjob(carid,2);
                
TogglePlayerControllable(playerid,true);
            }
            if(
listitem == 3) {
                new 
Float:X,Float:Y,Float:Z,Float:Anglecarid;
                
GetPlayerPos(playerid,X,Y,Z);
                
GetPlayerFacingAngle(playerid,Angle);
                
carid GetPlayerVehicleID(playerid);
                
carid CreateVehicle(ID DO BULLLET,X,Y,Z,0.0,-1,-1,9000000);
                
//vehCriados[carid] = 1;
                
LinkVehicleToInterior(caridGetPlayerInterior(playerid));
                
AddVehicleComponent(carid,1163);
                
AddVehicleComponent(carid,1036);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1049);
                
AddVehicleComponent(carid,1040);
                
AddVehicleComponent(carid,1038);
                
AddVehicleComponent(carid,1147);
                
AddVehicleComponent(carid,1010);
                
AddVehicleComponent(carid,1079);
                
ChangeVehiclePaintjob(carid,2);
                
TogglePlayerControllable(playerid,true);
                return 
1;
            }
        }
    }
    return 
0;

Reply
#3

Bullet: 541
Elegy: 562
Infernus: 411
Sultan: 560
Reply
#4

Brigado Shadoww5 e CocaC0la, Topico Resolvido
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)