CMD:dvcreate(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 133 { new iVehicle, iColors[2], string[128]; if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) { return SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /dvcreate [model ID] [color 1] [color 2]"); } if(!(400 < iVehicle < 612)) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid Model ID"); else if(IsATrain(iVehicle)) { SendClientMessageEx(playerid, COLOR_GREY, "Trains cannot be spawned during runtime."); } else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) { SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (IDs start at 0, and end at 255)."); } mysql_function_query(MainPipeline, "SELECT id from `groupvehs` WHERE vModel = 0 LIMIT 1;", true, "DynVeh_CreateDVQuery", "iiii", playerid, iVehicle, iColors[0], iColors[1]); format(string, sizeof(string), "%s has created a dynamic vehicle.", GetPlayerNameEx(playerid)); Log("logs/dv.log", string); } else return SendClientMessage(playerid, COLOR_GRAD2, "Ban khong the su dung lenh nay."); return 1; } |
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren=0)
addsiren Added in 0.3.7; will not work in earlier versions. Has a default value 0. Enables the vehicle to have a siren, providing the vehicle has a horn.
CMD:dvcreate(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 133 { new vehicleid iVehicle, iColors[2], iaddsiren, string[128]; if(sscanf(params, "iiiI", iVehicle, iColors[0], iColors[1], iaddsiren)) { return SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /dvcreate [model ID] [color 1] [color 2] [Siren type]"); } if(!(400 < iVehicle < 612)) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid Model ID"); else if(IsATrain(iVehicle)) { SendClientMessageEx(playerid, COLOR_GREY, "Trains cannot be spawned during runtime."); } else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) { SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (IDs start at 0, and end at 255)."); } mysql_function_query(MainPipeline, "SELECT id from `groupvehs` WHERE vModel = 0 LIMIT 1;", true, "DynVeh_CreateDVQuery", "iiiI", playerid, iVehicle, iColors[0], iColors[1], iaddsiren); format(string, sizeof(string), "%s has created a dynamic vehicle.", GetPlayerNameEx(playerid)); Log("logs/dv.log", string); } else return SendClientMessage(playerid, COLOR_GRAD2, "Ban khong the su dung lenh nay."); return 1; } |
/dvcreate 415 1 1 1 [10:52:11] sscanf warning: Format specifier does not match parameter count. |
if(sscanf(params, "iiii", iVehicle, iColors[0], iColors[1], iaddsiren))
CMD:dvcreate(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
new vehicleid
iVehicle,
iColors[2],
iaddsiren,
string[128]
;
if(sscanf(params, "iiii", iVehicle, iColors[0], iColors[1], iaddsiren))
return SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /dvcreate [model ID] [color 1] [color 2] [Siren type]");
if(!(400 < iVehicle < 612))
return SendClientMessage(playerid, COLOR_GRAD2, "Invalid Model ID");
else if(IsATrain(iVehicle))
return SendClientMessageEx(playerid, COLOR_GREY, "Trains cannot be spawned during runtime.");
else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255))
return SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid color specified (IDs start at 0, and end at 255).");
mysql_function_query(MainPipeline, "SELECT id from `groupvehs` WHERE vModel = 0 LIMIT 1;", true, "DynVeh_CreateDVQuery", "iiiI", playerid, iVehicle, iColors[0], iColors[1], iaddsiren);
format(string, sizeof(string), "%s has created a dynamic vehicle.", GetPlayerNameEx(playerid));
Log("logs/dv.log", string);
}
else return SendClientMessage(playerid, COLOR_GRAD2, "Ban khong the su dung lenh nay.");
return 1;
}