Jump to content
  • 0

get private car


[pepsi]

Question

deci asta e comanda de /nrg[table]

COMMAND:nrg(playerid, params[])

  {

            new string[256];

        if(pNRG[playerid] > 0)

        {

            if(GetPlayerVehicleID(playerid) != pNRG[playerid])

            {

              if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);

              new Float: X, Float: Y, Float: Z, Float: Ang;

              GetPlayerPos(playerid, X, Y, Z);

              GetPlayerFacingAngle(playerid, Ang);

                SetVehicleVirtualWorld(pNRG[playerid],GetPlayerVirtualWorld(playerid));

              PutPlayerInVehicle(playerid, pNRG[playerid], 0);

              SetVehiclePos(pNRG[playerid], X, Y, Z);

              SetVehicleZAngle(pNRG[playerid], Ang);

              SetVehicleHealth(pNRG[playerid],  1000.0);

              LinkVehicleToInterior(pNRG[playerid], GetPlayerInterior(playerid));

                TextDrawShowForPlayer(playerid,  MsgNrg);

                    SetTimerEx("Hide", 3500, false, "d", playerid ,string);

            }

            else

            {

              SendClientMessage(playerid,0xCC0000AA, "{00C0FF}Ai deja un {F81414}NRG-500!");

            }

        }

        else

        {

            if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);

            new Float: X, Float: Y, Float: Z, Float: Ang;

            GetPlayerPos(playerid, X, Y, Z);

            GetPlayerFacingAngle(playerid, Ang);

            pNRG[playerid] = CreateVehicle(522, X, Y, Z+3, Ang, 75,3, 5000000);

            PutPlayerInVehicle(playerid, pNRG[playerid], 0);

            SetVehicleVirtualWorld(pNRG[playerid],GetPlayerVirtualWorld(playerid));

            LinkVehicleToInterior(pNRG[playerid], GetPlayerInterior(playerid));

            printf("Personal NRG Created For %s.", PlayerName2(playerid));

                TextDrawShowForPlayer(playerid,  MsgNrg);

                SetTimerEx("Hide", 3500, false, "d", playerid ,string);

            for(new i=0; i < MAX_PLAYERS; i++)

            {

              if (IsPlayerConnected(i) && i != playerid)

              {

                  SetVehicleParamsForPlayer(pNRG[playerid], i, 0, 1);

                  }

              }

        }

            return 1;

  }

[/table] ce ar trebuii sa ii fac sa imi aduca masina privata prin comanda /mycar ?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Dublezi comanda /nrg, si o numesti /mycar, schimbi variabila pNRG in pMYCAR (dublezi variabila si o redenumesti asa peste tot in script) si schimbi id-ul vehiculului cu ce vrei tu, de la linia asta:

pNRG[playerid] = CreateVehicle(522, X, Y, Z+3, Ang, 75,3, 5000000);

Nu se cer scripturi.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.