05.04.2016, 19:05
as for the spawning command, asssuming you use sscanf and ZCMD
PHP код:
CMD:v(playerid,params[])
{
new String[200];
new Float:x, Float:y, Float:z;
if(!IsNumeric(params)) return SendClienMessage(playerid, -1, "use only numbers");
new vehiclee = GetModelVehicle(params);
if(!strlen(params)) return SendClientMessage(playerid, -1, "[USAGE] /v (Car Name)");
if(vehiclee < 400 || vehiclee > 611) return SendClientMessage(playerid, -1, "[ERROR] That vehicle name does not exist in our database.");
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
new mrand =random(200);
new frand =random(200);
new PlayersVehicle = CreateVehicle(vehiclee, x+2, y+2, z, a+90, mrand, frand, -1);
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
format(String, sizeof(String), "[VEHICLE] You have spawned a vehicle. [Vehicle: %s]", NameVehicles[vehiclee - 400]);
SendClientMessage(playerid, -1, String);
return 1;
}
PHP код:
CMD:vcolor(playerid,params[])
{
new String[200];
new x, y;
new vid = GetPlayerVehicleID(playerid);
if(sscanf(params, "ii", x,y))
{
SendClientMessage(playerid, -1, "[USAGE] /vcolor (0-255) (0-255)");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "[ERROR] You must be in a vehicle to use this command.");
ChangeVehicleColor(vid,x, y);
format(String, sizeof(String), "[VEHICLE] You have set your vehicle color to [%d] and[%d]", x, y);
SendClientMessage(playerid, -1, String);
return 1;
}