/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
#2

Are you in the wrong VW maybe? Was this command made by yourself?
Reply
#3

Mine.
Reply
#4

Try spawning it with the vehicle ID instead of name
Reply
#5

Nah, not working.
Reply
#6

Please, lock this. I will create a new topic with better explanation as this is not the problem.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)