Jump to content

Question

Posted

Nu stiu ce are da cand dau /car ar trebui sa imi returneze SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE:{FFFFFF} /car [modelid/carname] [color1] [color2]"); dar imi da Unknown command.

Any tips?

[pawn]CMD:car(playerid, params[])

{

if(DMZONE[playerid] == 1 || DMZONE[playerid] == 2) return SendClientMessage(playerid, COLOR_RED, "ERROR: {FFFFFF}You can't spawn a vehicle in dm zone.");

iSeat = GetPlayerVehicleSeat(playerid);

if(!(iSeat == 0 || iSeat == -1)) return SendClientMessage(playerid, COLOR_RED, "ERROR: {FFFFFF}You can't spawn a car if you are into someones vehicle.");

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} /car [modelid/carname] [color1] [color2]");

new string[128];

new colour1, colour2;

if(!IsNumeric(tmp))

car = GetVehicleModelIDFromName(tmp);

else car = strval(tmp);

if( car == 520 || car == 432 || car == 425 || car == 435 || car == 447 || car == 450 || car == 465 || car == 464 || car == 476 || car == 501 || car == 537 || car == 538 || car == 564 || car == 569 || car == 570 || car == 584 || car == 590 || car == 591 || car == 594 || car == 606 || car == 607 || car == 608 || car == 610 || car == 611 )

return SendClientMessage(playerid,COLOR_RED,"ERROR: {FFFFFF}This model is blacklisted");

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,Y,Z, Angle, colour1, colour2, -1);

LinkVehicleToInterior(LVehicleID,int1);

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

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

AddVehicleComponent(car, 1010);

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

return SendClientMessage(playerid, COLOR_RED, string);

}[/pawn]

signature.php?bg=000000&text=FFFFFF&border=a0a0a0&ip=176.31.142.87&port=7777&bg_image=

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.