I need a command that the Admin use vehicles to park concessionaire (RPG Server)
#1

I need a command that the Admin use vehicles to park concessionaire (RPG Server)

Command normal that players use to park their vehicles:
pawn Код:
if(strcmp(tmp, "park", true) == 0)
        {
            if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
                return true;
            }
            if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
                return true;
            }
            new Float:x,Float:y,Float:z;
            new Float:a;
            new carid;
            new getcarid;
            new Veiculo;
            if(vehid == PlayerInfo[playerid][pCarKey]) { carid = PlayerInfo[playerid][pCarKey]; Veiculo = PlayerInfo[playerid][pVeiculo]; }
            else if(vehid == PlayerInfo[playerid][pCarKey2]) { carid = PlayerInfo[playerid][pCarKey2]; Veiculo = PlayerInfo[playerid][pVeiculo2]; }
            if(IsPlayerInVehicle(playerid,carid) && CarInfo[Veiculo][cOwned] == 1)
            {
                getcarid = GetPlayerVehicleID(playerid);
                GetPlayerName(playerid, playername, sizeof(playername));
                GetVehiclePos(carid, x, y, z);
                GetVehicleZAngle(carid, a);
                if(getcarid == carid)
                {
                    CarInfo[Veiculo][cLocationx] = x;
                    CarInfo[Veiculo][cLocationy] = y;
                    CarInfo[Veiculo][cLocationz] = z;
                    CarInfo[Veiculo][cAngle] = a;
                    format(string, sizeof(string), "~n~ Veiculo Estacionado Aqui! ~n~");
                    GameTextForPlayer(playerid, "Veiculo Estacionado!~n~Ele vai nascer aqui!.", 10000, 3);
                    DestroyVehicle(carid);
                    new carid2 = CreateVehicle(CarInfo[Veiculo][cModel],CarInfo[Veiculo][cLocationx],CarInfo[Veiculo][cLocationy],CarInfo[Veiculo][cLocationz]+1.0,CarInfo[Veiculo][cAngle],CarInfo[Veiculo][cColorOne],CarInfo[Veiculo][cColorTwo],60000);
                    Controle(playerid, 1);
                    SaveCars();
                    SetVehicleToRespawn(carid2);
                    return true;
                }
                return true;
            }
            return true;
        }
Reply
#2

pawn Код:
if (strcmp("/apark", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You aren't in a vehicle.");
        new vehicle = GetPlayerVehicleID(playerid);
        new Float:x, Float:y, Float:z, Float:c;
        GetVehiclePos(vehicle, Float:x, Float:y, Float:z);
        GetVehicleZAngle(vehicle, Float:c);
        CarInfo[vehicle][cLocationx] = x;
        CarInfo[vehicle][cLocationy] = y;
        CarInfo[vehicle][cLocationz] = z;
        CareInfo[vehicle][cAngle] = c;
        SaveCars();
        return 1;
    }
Reply
#3

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
pawn Код:
if (strcmp("/apark", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You aren't in a vehicle.");
        new vehicle = GetPlayerVehicleID(playerid);
        new Float:x, Float:y, Float:z, Float:c;
        GetVehiclePos(vehicle, Float:x, Float:y, Float:z);
        GetVehicleZAngle(vehicle, Float:c);
        CarInfo[vehicle][cLocationx] = x;
        CarInfo[vehicle][cLocationy] = y;
        CarInfo[vehicle][cLocationz] = z;
        CareInfo[vehicle][cAngle] = c;
        SaveCars();
        return 1;
    }
When I use in a vehicle appears:
SERVER: Unknown Command
Reply
#4

Show me an example of a command that you already have.
Reply
#5

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
Show me an example of a command that you already have.
Command used by normal players (This is part of the command / v) :
pawn Код:
if(strcmp(tmp, "park", true) == 0)
        {
            if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "Do not have a VIP car.");
                return true;
            }
            if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
            {
                SendClientMessage(playerid, COLOR_GREY, "This is not your car VIP.");
                return true;
            }
            new Float:x,Float:y,Float:z;
            new Float:a;
            new carid;
            new getcarid;
            new Veiculo;
            if(vehid == PlayerInfo[playerid][pCarKey]) { carid = PlayerInfo[playerid][pCarKey]; Veiculo = PlayerInfo[playerid][pVeiculo]; }
            else if(vehid == PlayerInfo[playerid][pCarKey2]) { carid = PlayerInfo[playerid][pCarKey2]; Veiculo = PlayerInfo[playerid][pVeiculo2]; }
            if(IsPlayerInVehicle(playerid,carid) && CarInfo[Veiculo][cOwned] == 1)
            {
                getcarid = GetPlayerVehicleID(playerid);
                GetPlayerName(playerid, playername, sizeof(playername));
                GetVehiclePos(carid, x, y, z);
                GetVehicleZAngle(carid, a);
                if(getcarid == carid)
                {
                    CarInfo[Veiculo][cLocationx] = x;
                    CarInfo[Veiculo][cLocationy] = y;
                    CarInfo[Veiculo][cLocationz] = z;
                    CarInfo[Veiculo][cAngle] = a;
                    format(string, sizeof(string), "~n~ Vehicle Parked Here! ~n~");
                    GameTextForPlayer(playerid, "Vehicle Parked! ~n~ He will be born here!.", 10000, 3);
                    DestroyVehicle(carid);
                    new carid2 = CreateVehicle(CarInfo[Veiculo][cModel],CarInfo[Veiculo][cLocationx],CarInfo[Veiculo][cLocationy],CarInfo[Veiculo][cLocationz]+1.0,CarInfo[Veiculo][cAngle],CarInfo[Veiculo][cColorOne],CarInfo[Veiculo][cColorTwo],60000);
                    Controle(playerid, 1);
                    SaveCars();
                    SetVehicleToRespawn(carid2);
                    return true;
                }
                return true;
            }
            return true;
        }
Reply
#6

Help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)