/veh command problem
#1

The command:
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;
}
I dont get it, it says the vehicle has been spawned but the vehicle is not spawned.
Reply


Messages In This Thread
/veh command problem - by benjaminjones - 27.08.2015, 21:24
Re: /veh command problem - by Gazzy - 27.08.2015, 21:26
Re: /veh command problem - by benjaminjones - 27.08.2015, 21:27
Re: /veh command problem - by Gazzy - 27.08.2015, 21:30
Re: /veh command problem - by benjaminjones - 27.08.2015, 21:38
Re: /veh command problem - by benjaminjones - 27.08.2015, 23:14

Forum Jump:


Users browsing this thread: 1 Guest(s)