06.05.2014, 10:53
pawn Код:
CMD:veh(playerid, params[])
{
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "Error. Usage: /veh [modelid]"); //Check if the parameter exists.
if(strval(params) > 611 || strval(params) < 400) return SendClientMessage(playerid, COLOR_RED, "Error. Models are between 400 and 611."); //Check if it's between 400 and 611.
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Трябва да влезите в профила си, за да използвате командите.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "Вие нямате права, за да използвате тази команда.");
new Float:x, Float:y, Float:z; //Declare position variables.
GetPlayerPos(playerid, x, y, z); //Get the players position, the vehicle will spawn in this position.
PutPlayerInVehicle(playerid, CreateVehicle(strval(params), x, y, z, 0.0, -1, -1, -1), 0); //Create the vehicle, put the player in it as the driver.
return 1; //Tell the server the command executed succesfully.
}