SA-MP Forums Archive
Delete cars - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Delete cars (/showthread.php?tid=501243)



Delete cars - Ananisiki - 17.03.2014

So, i have two car spawn commands, one is admin vehicles and one is normal vehicles, i can delete the admin ones but not the normal ones, it says that its static,

pawn Code:
if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be In A Vehicle To Use This Command.");
        if(AdminCar[GetPlayerVehicleID(playerid)] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Delete A Static Car.");
        format(log, sizeof log, "Admin %s Has Deleted Vehicle ID %d. Model: %d.", PlayerName(playerid), GetPlayerVehicleID(playerid), GetVehicleModel(GetPlayerVehicleID(playerid)));
        DestroyVehicle(GetPlayerVehicleID(playerid));
        return 1;
    }
    else if(!sscanf(params, "d", vehid))
    {
        if(!IsValidVehicle(vehid)) return SendClientMessage(playerid, COLOR_RED, "This Vehicle Doesn't Exist In The Server.");
        if(AdminCar[vehid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Delete A Static Car.");
        format(log, sizeof log, "Admin %s Has Deleted Vehicle ID %d. Model: %d.", PlayerName(playerid), vehid, GetVehicleModel(vehid));
        DestroyVehicle(vehid);
        return 1;

    }
Ive tryed adding

pawn Code:
if(AdminCar[vehid] && NormalCar[vehid] == 0)
but it doesnt work...


Re: Delete cars - AleemIqbalBhatti - 17.03.2014

if(AdminCar[vehid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Delete A Static Car.");
remove it
maybe it will work


Re: Delete cars - Ananisiki - 17.03.2014

What?

Stop posting non-sense stuff please....


Re: Delete cars - VishvaJeet - 18.03.2014

Show me full cmd start to end
then i can understand what you need


Re: Delete cars - AroseKhanNiazi - 18.03.2014

if(AdminCar[vehid] == 0) this won't let u delete any other veh


Re: Delete cars - Ananisiki - 18.03.2014

It lets me to remove the admin car and not static vehicles which is good, but i want to add NormalCar too


Re: Delete cars - Ananisiki - 19.03.2014

Bump


Re: Delete cars - AroseKhanNiazi - 19.03.2014

this will return if the car is not admin car it doesn't matter if it's any else car it wont let u delete it until it's admin car


Re: Delete cars - Ananisiki - 19.03.2014

But it does


Re: Delete cars - AroseKhanNiazi - 19.03.2014

this means if it's not admin car it wont let u delete it