[Ajuda] veiculo
#1

glr to precisando de uma ajuda no meu sv quando eu pego um carro e outro admin (que esta longe) cria tbm o carro dos outros somem e so o dele fica vou ta postando o code aqui pra vcs verem mt obrigado quem ajudar

PHP код:
if(strcmp(cmd"/cv"true) == 0)
{
    if(
pAdmin[playerid] == || pAdmin[playerid] == || pAdmin[playerid] == || pAdmin[playerid] == || pAdmin[playerid] == 5) {
  new 
plid;
        new 
Float:X,Float:Y,Float:Z,Float:Angle;
  
tmp strtok(cmdtextidx);
            if(!
strlen(tmp)) {
            
SendClientMessage(playeridVermelho"| ERRO | Digite: /cv [id-do-caro]");
            return 
1;
        }
     
plid strval(tmp);
    if(
plid==594) {
    
SendClientMessage(playeridVermelho"| ERRO | ID de carro Proibido!");
    return 
1;
        }
        if(
IsPlayerConnected(playerid)) {
                if(
plid >= 400 && plid <= 611) {
                if(
carroadmin[playerid] != -1DestroyVehicle(carroadmin[playerid]);
                
GetPlayerPos(playerid,X,Y,Z);
                
GetPlayerFacingAngle(playerid,Angle);
                
carroadmin[playerid] = CreateVehicle(plidXYZAngle, -1, -1120000);
                
SetVehicleNumberPlate(carroadmin[playerid], "RLNE-Admin");
                
PutPlayerInVehicle(playerid,carroadmin[playerid],0);
                if(
GetPlayerInterior(playerid))
                
LinkVehicleToInterior(carroadmin[playerid],GetPlayerInterior(playerid));
                
format(stringsizeof(string), "| RLNE-Admin | Vocк criou o veнculo {FFFFFF}'{0CB80C}%s{FFFFFF}' {13A9F6}ID {FFFFFF}'{0CB80C}%d{FFFFFF}' !"PlayerVehicle[GetVehicleModel(GetPlayerVehicleID(playerid))-400],plid);
                
SendClientMessage(playeridocdstring);
                
SendClientMessage(playeridocd"| INFO | Ao sair do veнculo ele serб automaticamente deletado!");
                
cVehicle[playerid] = true;
                return 
1;
            }
                else {
                
SendClientMessage(playeridVermelho"| ERRO | ID invбlido | ID's = 400-611");
                return 
1;
            }
        }
    }

Reply
#2

Tenta...

PHP код:
if(strcmp(cmd"/cv"true) == 0)
{
    if(
pAdmin[playerid])
    {
          new 
plid;
          
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridVermelho"| ERRO | Digite: /cv [id-do-caro]");
        }
        else
        {
            
plid strval(tmp);
            if(
plid==594)
            {
                
SendClientMessage(playeridVermelho"| ERRO | ID de carro Proibido!");
            }
            else
            {
                 if(
plid >= 400 && plid <= 611)
                {
                    if(
carroadmin[playerid] != -1)
                    {
                        
DestroyVehicle(carroadmin[playerid]);
                    }
                    new 
Float:X,Float:Y,Float:Z,Float:Angle;
                    
GetPlayerPos(playerid,X,Y,Z);
                    
GetPlayerFacingAngle(playerid,Angle);
                    
carroadmin[playerid] = CreateVehicle(plidXYZAngle, -1, -1120000);
                    
SetVehicleNumberPlate(carroadmin[playerid], "RLNE-Admin");
                    
PutPlayerInVehicle(playerid,carroadmin[playerid],0);
                    if(
GetPlayerInterior(playerid))
                    {
                           
LinkVehicleToInterior(carroadmin[playerid],GetPlayerInterior(playerid));
                    }
                    
format(stringsizeof(string), "| RLNE-Admin | Vocк criou o veнculo {FFFFFF}'{0CB80C}%s{FFFFFF}' {13A9F6}ID {FFFFFF}'{0CB80C}%d{FFFFFF}' !"PlayerVehicle[GetVehicleModel(GetPlayerVehicleID(playerid))-400],plid);
                    
SendClientMessage(playeridocdstring);
                    
SendClientMessage(playeridocd"| INFO | Ao sair do veнculo ele serб automaticamente deletado!");
                    
cVehicle[playerid] = true;
                }
                else
                {
                       
SendClientMessage(playeridVermelho"| ERRO | ID invбlido | ID's = 400-611");
                }
            }
        }
    }
    return 
1;

Reply
#3

if(PlayerInfo[playerid][pAdmin] >= 1)
{
new modelo, carro,
Float:X, Float:Y, Float:Z, Float:Angle;

if(sscanf(params, "d", modelo)) return SendClientMessage(playerid, vermelho, "[ERRO] Comando Incorreto, Use: /cv [modelo]");
if(IsPlayerConnected(playerid))
{
if(modelo >= 400 && modelo <= 611)
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, vermelho, "[ERRO] Saia deste veнculo para criar outro.");
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
carro = AddStaticVehicleEx(modelo, X, Y, Z, Angle, -1, -1, 30);
PutPlayerInVehicle(playerid, carro, 0);
}
else return SCM(playerid, vermelho, "[ERRO] Id invбlido, use use: ID's = 400-611");
}
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)