Help, Admincar respawn
#1

I already posted a topic about it, but so lazy to search the post :S

so here's my problem i cant get my admin car destroyed! i dont get any error neither bug.. but its not working,
if i go off duty the vehicle is not destroyed!!

pawn Код:
CMD:acar(playerid, params[])
{
    if(aDuty[playerid] == 1)
    if(PlayerInfo[playerid][pAdmin] >= 1)
        {
        if(LastAdminVehicle[playerid] != 0) DestroyVehicle(LastAdminVehicle[playerid]);
        if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, C_RED, "You are already in a vehicle!");

        new Float:XYZ[3], Float:Angle;
        GetPlayerPos(playerid, XYZ[0], XYZ[1], XYZ[2]);
        GetPlayerFacingAngle(playerid, Angle);
        new car = CreateVehicle(596, XYZ[0]+1.0, XYZ[1]+1.0, XYZ[2], Angle, 232, 232, -1);
        PutPlayerInVehicle(playerid, car, 0);
        LastAdminVehicle[playerid] = GetPlayerVehicleID(playerid);
        }
        else
        {
        aDuty[playerid] = 0;
        DestroyVehicle(LastAdminVehicle[playerid]);
        SendClientMessage(playerid, C_RED, "You can't use the admin car, when off-duty!!");
    }
    return 1;
}
thanks in advance!
Reply
#2

Show us code for the "off-duty" command.
Reply
#3

i'm not sure.

but try to change

pawn Код:
LastAdminVehicle[playerid] = GetPlayerVehicleID(playerid);
to this

pawn Код:
LastAdminVehicle[playerid] = car;
Reply
#4

If you have a Admin-duty command, be sure to assing the variable into the array. First, above you do
pawn Код:
LastAdminVehicle[playerid] = car;
and then be sure to use a check the admin-duty command, checking if he is going on or off duty. If he goes off duty, make the
pawn Код:
DestroyVehicle(LastAdminVehicle[playerid]);
take place.
Reply
#5

thanks ya all, i forgot to add the destroy vehicle in aduty cmd after airplaneisman told...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)