Admin Cars
#1

pawn Код:
dcmd_acar(playerid,params[])
{
   #pragma unused params
   new Float:X,Float:Y,Float:Z,Float:ROT;
    {
        GetPlayerFacingAngle(playerid,ROT);
        GetPlayerPos(playerid,X,Y,Z);
        CreateVehicle(411,3+X,Y,Z,ROT,5,5,0);
        return 1;
    }
}
for example I do it twice, I want a /destoryall command. and /destroy if in vehicle..

and a /v (carname) (color1) (color)2 command please,

Thanks
Reply
#2

Command for destroying vehicle if player is in a vehicle.
pawn Код:
dcmd_destroyv(playerid,params[])
{
 #pragma unused params
   if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000, "You must be in a vehicle to use this command.");
   new pVeh;
   pVeh = GetPlayerVehicleID(playerid);
   DestroyVehicle(pVeh);
   return 1;
}
Sorry if mistakes are there,because Im doing this through my mobile.
Reply
#3

Okay, can you show me a /v command?

EDIT: false command, it's not destroying the car.
Reply
#4

pawn Код:
dcmd_v(playerid,params[])
{
 #pragma unused params
   new vehid;
   new color1;
   new color2;
   if(sscanf(params,"i",vehid,color1,color2)) return SendClientMessage(playerid, 0xFF0000, "Usage:/v [vehicleid] [color1] [color2]");
   new Float:x,Float:y,Float:z,Float:ang;
   GetPlayerFacingAngle(playerid,ang);
   GetPlayerPos(playerid,x,y,z);
   CreateVehicle(vehid,x+1,y+1,z+1,ang,color1,color2,60);
    return 1;
}
Sorry if mistakes are there.
Edit:This required sscanf plugin and include also.
Reply
#5

I do have sscanf2
Reply
#6

pawn Код:
CMD:dv(playerid, params[])
{
static
vehID
;
if ( sscanf( params, "i",  vehID ) )
return SendClientMessage( playerid, COLOR_RED, "SYNTAX: /dv < vehID >" );

if ( vehID == INVALID_VEHICLE_ID )
return SendClientMessage( playerid, COLOR_RED, "ERROR: Invalid vehicle ID." );

DestroyVehicle(vehID);
return 1;
}
Reply
#7

Then no probs.
You can also use sscanf2.
Reply
#8

It's not destroying the car, lol :P
Reply
#9

my code will.. it works perfect for me.
Reply
#10

Sorry Jarnu, did see your post x_x let me try it.
EDIT: can you do it if player in vehicle?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)