[AJUDA]Neon continua no veнculo depois de RESPAWN
#1

Galera preciso de uma ajudinha aqui rapidinho, tenho um sistema de NEON, mais sу que quando o carro RESPAWN o veнculo continua com NEON, se alguem souber resolver este problema para mim fico muito grato a vocкs


Dialog do Neon:
PHP код:
if(dialogid == neondialog)
        {
                if(
response)
                {
                        if(
listitem == 0)
                        {
                            
SetPVarInt(playerid"Status"1);
                
SetPVarInt(playerid"neon"CreateObject(18648,0,0,0,0,0,0));
                
SetPVarInt(playerid"neon1"CreateObject(18648,0,0,0,0,0,0));
                
AttachObjectToVehicle(GetPVarInt(playerid"neon"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
                
AttachObjectToVehicle(GetPVarInt(playerid"neon1"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
                
SendClientMessage(playerid0xAA3333AA"Neon instalado com sucesso.");
                        }
                        if(
listitem == 1)
                        {
                                
SetPVarInt(playerid"Status"1);
                    
SetPVarInt(playerid"neon2"CreateObject(18647,0,0,0,0,0,0));
                    
SetPVarInt(playerid"neon3"CreateObject(18647,0,0,0,0,0,0));
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon2"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon3"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
                    
SendClientMessage(playerid0xAA3333AA"Neon instalado com sucesso.");
            }
                        if(
listitem == 2)
                        {
                            
SetPVarInt(playerid"Status"1);
                    
SetPVarInt(playerid"neon4"CreateObject(18649,0,0,0,0,0,0));
                    
SetPVarInt(playerid"neon5"CreateObject(18649,0,0,0,0,0,0));
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon4"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon5"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
                    
SendClientMessage(playerid0xAA3333AA"Neon instalado com sucesso.");
                    }
                        if(
listitem == 3)
                        {
                            
SetPVarInt(playerid"Status"1);
                    
SetPVarInt(playerid"neon6"CreateObject(18652,0,0,0,0,0,0));
                    
SetPVarInt(playerid"neon7"CreateObject(18652,0,0,0,0,0,0));
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon6"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon7"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
                    
SendClientMessage(playerid0xAA3333AA"Neon instalado com sucesso.");
            }
                        if(
listitem == 4)
                        {
                            
SetPVarInt(playerid"Status"1);
                    
SetPVarInt(playerid"neon8"CreateObject(18651,0,0,0,0,0,0));
                    
SetPVarInt(playerid"neon9"CreateObject(18651,0,0,0,0,0,0));
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon8"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon9"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
                    
SendClientMessage(playerid0xAA3333AA"Neon instalado com sucesso.");
            }
            if(
listitem == 5)
                        {
                                
SetPVarInt(playerid"Status"1);
                    
SetPVarInt(playerid"neon10"CreateObject(18650,0,0,0,0,0,0));
                    
SetPVarInt(playerid"neon11"CreateObject(18650,0,0,0,0,0,0));
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon10"), GetPlayerVehicleID(playerid), -0.80.0, -0.700.00.00.0);
                    
AttachObjectToVehicle(GetPVarInt(playerid"neon11"), GetPlayerVehicleID(playerid), 0.80.0, -0.700.00.00.0);
                    
SendClientMessage(playerid0xAA3333AA"Neon instalado com sucesso.");
            }
                        if(
listitem == 6)
                        {
            
DestroyObject(GetPVarInt(playerid"neon"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon1"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon2"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon3"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon4"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon5"));
                        
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon6"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon7"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon8"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon9"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon10"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon11"));
            
DeletePVar(playerid"Status");
            
DestroyObject(GetPVarInt(playerid"neon12"));
            
DeletePVar(playerid"Status");
            
SendClientMessage(playerid0xAA3333AA"Neon retirado com sucesso.");
            }
           }
        } 
Reply
#2

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    DestroyObject(GetPVarInt(playerid, "neon"));
    for(new i = 1; i < 12; i++)
    {
        new sStr[7]
        format(sStr,7,"neon%i",i);
        DestroyObject(GetPVarInt(playerid, sStr));
    }
    DeletePVar(playerid, "Status");
    return 1;
}
Reply
#3

Assim que o veнculo for tiver respawn, destrua os objetos do neon

pawn Код:
public OnVehicleSpawn(vehicleid)
Reply
#4

Coloque isto:

Код:
public OnVehicleSpawn(vehicleid)
{
    DestroyObject(GetPVarInt(vehicleid, "neon"));
    for(new i = 1; i < 12; i++)
    {
        new sStr[7];
        format(sStr,7,"neon%i",i);
        DestroyObject(GetPVarInt(vehicleid, sStr));
    }
    DeletePVar(vehicleid, "Status");
    return 1;
}
mais nгo adianto :\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)