Destroy Object help
#1

pawn Код:
//Lightbar Lighting CMD
CMD:lightflashonwe(playerid,params[]){//                    admin
    if(GetPVarInt(playerid,"Lights")>0)
    {
        SetPVarInt(playerid,"Lights",0);
        if(IsValidObject(GetPVarInt(playerid,"Siren1")))
        {
            DestroyObject(GetPVarInt(playerid,"Siren1"));
            SendClientMessage(playerid, COLOR_LIGHTBLUE,"[INFO]Lightbar lighting deactivated");
        }
        if(IsValidObject(GetPVarInt(playerid,"Siren2")))
        {
            DestroyObject(GetPVarInt(playerid,"Siren2"));
        }
    }
    else
    {
        SetPVarInt(playerid,"Lights",1);
        SetPVarInt(playerid,"OB1",CreateObject(18646,0,0,0,0,0,0,200));
        SetPVarInt(playerid,"OB2",CreateObject(18646,0,0,0,0,0,0,200));
        AttachObjectToVehicle(GetPVarInt(playerid,"OB1"),GetPlayerVehicleID(playerid),-0.4000,-0.2000,0.8500,0.0000,0.0000,0.0000);
        AttachObjectToVehicle(GetPVarInt(playerid,"OB2"),GetPlayerVehicleID(playerid),00.4000,-0.2000,0.8500,0.0000,0.0000,0.0000);
    }
    return 1;
}
All works fine but when i exit a vehicle the objets got removed, how i can let them remain until I re type /Lightflashon +REP
Reply


Messages In This Thread
Destroy Object help - by Gooday - 14.03.2012, 12:54
Re: Destroy Object help - by Tanush123 - 14.03.2012, 13:06
Re: Destroy Object help - by Gooday - 14.03.2012, 13:16
Re: Destroy Object help - by Tanush123 - 14.03.2012, 13:22
Re: Destroy Object help - by Gooday - 14.03.2012, 14:15

Forum Jump:


Users browsing this thread: 1 Guest(s)