27.08.2015, 21:24
The command:
I dont get it, it says the vehicle has been spawned but the vehicle is not spawned.
pawn Код:
CMD:veh(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 4)
{
new Vehicle[50];
if(!sscanf(params, "s[50]", Vehicle))
{
new string[128], Float:Pos[4];
GetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
new veh = GetVehicleModelID(Vehicle);
if(veh < 400 || veh > 611) return SendClientMessage(playerid, GREY, "That wasn't a valid vehicle name.");
if(!IsPlayerInAnyVehicle(playerid))
{
new vehicleid = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
format(string, sizeof(string), "AdmCmd: %s has just spawned a %s (VID: %d)", RemoveUnderScore(playerid), GetVehicleName(GetPlayerVehicleID(playerid)), GetPlayerVehicleID(playerid));
SendAdminMessage(RED, string);
}
else return SendClientMessage(playerid, GREY, "You mustn't be in a vehicle to use this command.");
}
else return SendClientMessage(playerid, GREY, "Usage: /veh [vehiclename]");
}
else return SendClientMessage(playerid, GREY, AdminOnly);
return 1;
}