08.03.2015, 08:20
@bondowocopz: Really? Don't ever post untested commands/codes. It's not optional in your code.
The proper code would be:
INFO:
I(0) - If nothing has been entered by the user, it chooses 0 as the color. You can change that (0) to any vehicle color value.
The proper code would be:
pawn Код:
CMD:car(playerid,params[])
{
new string[128],cID,cID2,vID;
new Float:x,Float:y,Float:z;
if(PInfo[playerid][Level] < 1)
return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 2 to use this command.");
if(sscanf(params,"dI(0)I(0)",vID,cID,cID2))
return SendClientMessage(playerid,COLOR_INDIANRED,"USAGE /car [NAME] Optional: [COLOR1] [COLOR2]");
if(vCar[playerid] != -1)
{
DestroyVehicle(vCar[playerid]);
}
CMDMessageToAdmins(playerid,"CAR");
GetPlayerPos(playerid,x,y,z);
vCar[playerid] = CreateVehicle(vID,x+2,y,z,0,cID,cID2,0);
PutPlayerInVehicle(playerid,vCar[playerid], 0);
LinkVehicleToInterior(vCar[playerid], GetPlayerInterior(playerid));
format(string,sizeof(string),"You have spawned vehicle %d with color %d and %d.",vID,cID,cID2);
SendClientMessage(playerid,COLOR_GREENYELLOW,string);
return 1;
}
pawn Код:
if(sscanf(params,"dI(0)I(0)",vID,cID,cID2))