Custom vehicle spawnposition change
#10

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Silly me!, This would compile properly, enjoy :P

pawn Код:
if(400 <= modelid <= 611)
Код:
This forum requires that you wait 240 seconds between posts. Please try again in 19 seconds. - you annoying little bitch.
Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Alright, I did alot of mistake there due to I was in a hurry :P

Full Fix Code
pawn Код:
CMD:customvehicle(playerid, params[])
{
    new playerb, string[128], modelid, slot, Positions[3];

    if(sscanf(params, "udd", playerb, slot, modelid))
        return SendClientMessage(playerid, COLOR_GREY, "USAGE: /customvehicle [playerid] [1-3] [modelid]");

    GetPlayerPos(playerb, Positions[0], Positions[1], Positions[2]);

    if(!IsPlayerLoggedIn(playerid))
        return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");

    if(400 <= modelid <= 611)
        return SendClientMessage(playerid, COLOR_GREY, "Vehicles are between 400 and 611.");

    if(PlayerInfo[playerid][pAdmin] < 3)
        return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");

    switch(slot)
    {
        case 1:
        {
            PlayerInfo[playerb][pVeh] = CreateVehicle(modelid, Positions[0], Positions[1], Positions[2], 0, 0, 32000);

            GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
            GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);

            PlayerInfo[playerb][vC1] = 0, PlayerInfo[playerb][vC2] = 0,
            PlayerInfo[playerb][vLocked] = 1, PlayerInfo[playerb][vModel] = modelid;
            SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);

            format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created a custom vehicle for (Slot 1) %s.", NORPN(playerid), NORPN(playerb)),
            SendAdminMessage(COLOR_DARKRED, 1, string);
        }
        case 2:
        {
            PlayerInfo[playerb][pVeh] = CreateVehicle(modelid, Positions[0], Positions[1], Positions[2], 0, 0, 32000);

            GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
            GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);

            PlayerInfo[playerb][vC1] = 0, PlayerInfo[playerb][vC2] = 0,
            PlayerInfo[playerb][vLocked] = 1, PlayerInfo[playerb][vModel] = modelid;
            SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);

            format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created a custom vehicle for (Slot 2) %s.", NORPN(playerid), NORPN(playerb)),
            SendAdminMessage(COLOR_DARKRED, 1, string);
        }
        case 3:
        {
            PlayerInfo[playerb][pVeh] = CreateVehicle(modelid, Positions[0], Positions[1], Positions[2], 0, 0, 32000);

            GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
            GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);

            PlayerInfo[playerb][vC1] = 0, PlayerInfo[playerb][vC2] = 0,
            PlayerInfo[playerb][vLocked] = 1, PlayerInfo[playerb][vModel] = modelid;
            SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);

            format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created a custom vehicle for (Slot 3) %s.", NORPN(playerid), NORPN(playerb)),
            SendAdminMessage(COLOR_DARKRED, 1, string);
        }
    }
    return true;
}
Compiled, no errors.

Altough it doesn't work, it says (also by proper vehicle ids for exemple turismo (451) ):

Vehicles are between 400 and 611.
Reply


Messages In This Thread
Custom vehicle spawnposition change - by Songason - 27.10.2013, 21:21
Re: Custom vehicle spawnposition change - by danilang9 - 27.10.2013, 21:30
Re: Custom vehicle spawnposition change - by Patrick - 27.10.2013, 21:41
Re: Custom vehicle spawnposition change - by Songason - 27.10.2013, 21:52
Re: Custom vehicle spawnposition change - by Patrick - 27.10.2013, 21:57
Re: Custom vehicle spawnposition change - by Songason - 27.10.2013, 21:58
Re: Custom vehicle spawnposition change - by Patrick - 27.10.2013, 22:01
Re: Custom vehicle spawnposition change - by danilang9 - 27.10.2013, 22:03
Re: Custom vehicle spawnposition change - by Patrick - 27.10.2013, 22:10
Re: Custom vehicle spawnposition change - by Songason - 27.10.2013, 22:38

Forum Jump:


Users browsing this thread: 5 Guest(s)