Jump to content
  • 0

Blacklist model car


bogdan.trial

Question

Salut, asa cum scrie si in titlu a-si dori sa pot adauga cateva modele de masini la blacklist, uite am aici comanda de spawn a masinilor.

[pawn]

new VehicleNames[212][] = {

{"Landstalker"},{"Bravura"}....etc...{"Utility Trailer"}

};

CMD:v(playerid, params[])

{

  new Index;

    new tmp[256];  tmp  = strtok(params,Index);

new tmp2[256]; tmp2 = strtok(params,Index);

new tmp3[256]; tmp3 = strtok(params,Index);

    if(!strlen(tmp)) return

SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE:{FFFFFF} /v [modelid/carname] [color1] [color2]");

new car;

new string[128];

new colour1, colour2;

  if(!IsNumeric(tmp))

car = GetVehicleModelIDFromName(tmp);

  else car = strval(tmp);

if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);

if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);

if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);

new Float:X,Float:Y,Float:Z;

new Float:Angle,int1;

new LVehicleID = GetPlayerVehicleID(playerid);

GetPlayerPos(playerid, X,Y,Z);

GetPlayerFacingAngle(playerid,Angle);

int1 = GetPlayerInterior(playerid);

SpawnedVehicles[playerid] = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);

LinkVehicleToInterior(LVehicleID,int1);

PlayerPlaySound(playerid,1085,0,0,0);

PutPlayerInVehicle(playerid,SpawnedVehicles[playerid],0);

format(string, sizeof(string), "SYSTEM:{FFFFFF} You spawned a %s", VehicleNames[car-400]);

return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

}[/pawn]

signature.php?bg=000000&text=FFFFFF&border=a0a0a0&ip=176.31.142.87&port=7777&bg_image=
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Deasupra la

if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
adaugi
if( car == model_vehicul_1 || car == model_vehicul_2 || etc. )
    return SendClientMessage( playerid, -1, "Acest vehicul este interzis !" );

model_vehicul_1 si 2 schimbi cu modelul vehiculelor interzise.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.