14.02.2011, 09:31
pawn Код:
COMMAND:v(playerid, params[])
{
if(!PLVL[playerid]) return 0;
if(PlayerInfo[playerid][pAdminLevel] >=3)
{
if(sscanf(params,"s",params)) return SendClientMessage(playerid, Yellow, "Usage: /v <vehicle ID/name>");
new vehicle = GetVehicleModelIDFromName(params);
if(IsNumeric(params)) vehicle = strval(params);
else vehicle = GetVehicleModelIDFromName(params);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, Red, "Invalid vehicle ID/name");
else
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
GetXYInFrontOfPlayer(playerid, x, y, 5.0);
CreateVehicle(vehicle, x, y, z, a, -1, -1, 100);
LinkVehicleToInterior(vehicle, GetPlayerInterior(playerid));
}
} else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
return 1;
}