aca te dejo el codigo del ladmin4v2 del comando car (con algunas modificaciones) y lo necesario para que funcione
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
new pCar[MAX_PLAYERS];
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(car, 3, cmdtext);
return 0;
}
pawn Код:
dcmd_car(playerid, params[]){
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
if(!strlen(tmp)) return SendClientMessage(playerid, red, "USO: /car [ID/Nombre] [color1] [color2]");
new car, colour1, colour2, string[128];
if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, red, "ERROR: ID del modelo erroneo");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
pcar[playerid] != -1 ) CarDeleter(PlayerInfo[playerid][pCar]);
new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
LinkVehicleToInterior(LVehicleID,int1);
pCar[playerid] = LVehicleID;
format(string, sizeof(string), "Has spawneado un \"%s\" (Modelo:%d) color (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
return SendClientMessage(playerid,lightblue, string);
}
pawn Код:
forward CarDeleter(vehicleid);
public CarDeleter(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++) {
new Float:X,Float:Y,Float:Z;
if(IsPlayerInVehicle(i, vehicleid)) {
RemovePlayerFromVehicle(i);
GetPlayerPos(i,X,Y,Z);
SetPlayerPos(i,X,Y+3,Z);
}
SetVehicleParamsForPlayer(vehicleid,i,0,1);
}
SetTimerEx("VehRes",1500,0,"i",vehicleid);
}
pawn Код:
forward VehRes(vehicleid);
public VehRes(vehicleid)
{
DestroyVehicle(vehicleid);
}
espero que te sirva si me olvide de algo avisame y me fijo