Removing Objects Off A Vehicle On Respawn
#1

Hi guys, I made a command to attach neons to your car but i don't know how to remove them when the car respawns,When i exit the car and it respawns the neons stay underneath :/.Any suggestions on what to do?

Код:
    COMMAND:neon1(playerid, params[]) // Blue Car Neon
    {
        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.8, 0.0, -0.70, 0.0, 0.0, 0.0);
        AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
        SendClientMessage(playerid, 0xFFFFFFAA, "† Blue Neons Added †");

I'm using ZCMD
Reply
#2

OnVehicleRespawn, remove it?
Reply
#3

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
OnVehicleRespawn, remove it?
What?
Reply
#4

He means: remove them when OnVehicleRespawn is called.
Reply
#5

pawn Код:
public OnVehicleRespawn(vehicleid)
{
    DestroyObject(GetPVarInt(playerid, "neon"));
    DestroyObject(GetPVarInt(playerid, "neon1"));
    return 1;
}
Reply
#6

Quote:
Originally Posted by Shadow™
Посмотреть сообщение
pawn Код:
public OnVehicleRespawn(vehicleid)
{
    DestroyObject(GetPVarInt(playerid, "neon"));
    DestroyObject(GetPVarInt(playerid, "neon1"));
    return 1;
}
If i write this in my mode i got two errors:
pawn Код:
D:\Drift.pwn(2852) : error 017: undefined symbol "playerid"
D:\Drift.pwn(2853) : error 017: undefined symbol "playerid"
Reply
#7

pawn Код:
public OnVehicleRespawn(vehicleid)
{
    for(new i=0; i<MAX_PLAYERS; i++)
   {
        DestroyObject(GetPVarInt(i, "neon"));
        DestroyObject(GetPVarInt(i, "neon1"));
   }
    return 1;
}
Reply
#8

I got no errors but its dont removed it...
Reply
#9

RemoveAttachedObject

i think :S
edit: RemovePlayerAttachedObject(playerid,id);
Reply
#10

try;

pawn Код:
public OnVehicleRespawn(vehicleid)
{
    DestroyObject(GetPVarInt(vehicleid, "neon"));
    DestroyObject(GetPVarInt(vehicleid, "neon1"));
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)