Need help..
#1

Hello!
Look this code below
pawn Код:
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");
            DestroyObject(GetPVarInt(playerid, "neon13"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "interior"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "interior1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "back"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "back1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "front"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "front1"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "undercover"));
            DeletePVar(playerid, "Status");
            DestroyObject(GetPVarInt(playerid, "undercover1"));
            DeletePVar(playerid, "Status");
This will destroy neon in every vehicle.I dont want it to destroy.
I want to make a admin command which will destroy neon in a particular vehicle.
How to do that can any body help me? ..
Reply
#2

pawn Код:
IsPlayerAdmin(playerid)
Reply
#3

I want to destroy neon only in 1 car.
If i use above code it will destroy all neon
Reply
#4

Код:
dcmd_destroyneon(playerid,params[]) {
   if(IsPlayerAdmin(playerid) ) {
	    if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /destroyneon[playerid]");
		new player1 = strval(params), string[128], Float:x, Float:y, Float:z;
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
			if(IsPlayerInAnyVehicle(player1)) {

				if(player1 != playerid) { format(string,sizeof(string),"Administrator \"%s\" has deleted objects from your vehicle", pName(playerid) ); SendClientMessage(player1,blue,string); }
				format(string,sizeof(string),"You have deleted \"%s\" objects from their vehicle", pName(player1)); SendClientMessage(playerid,blue,string);
 DestroyObject(GetPVarInt(player1, "neon"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon1"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon2"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon3"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon4"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon5"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon6"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon7"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon8"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon9"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon10"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon11"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon12"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "neon13"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "interior"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "interior1"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "back"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "back1"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "front"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "front1"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "undercover"));
            DeletePVar(player1, "Status");
            DestroyObject(GetPVarInt(player1, "undercover1"));
            DeletePVar(player1, "Status");
			} else return SendClientMessage(playerid,red,"ERROR: Player is not in a vehicle");
	    } else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
I think it should be something like in that code.
I didnt tested this, but u can.

and if anybody know how to add a some global code for deleteing all pVars from vehicle, and not to add so long code as this one.
Thanks and sorry for bad English xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)