[Tutorial] Spalatorie Auto

Tutoriale legate de jocul San Andreas Multy-Player!
Avatar utilizator
DarkArms
Membru
Mesaje: 3107
Localitate: Reșița, România
Nick server: cleks
Contact:

[Tutorial] Spalatorie Auto

Mesaj de DarkArms » Mie Oct 05, 2016 10:15 am

Salut, m-am gandit sa va postez un tutorial legat de "Spalatorie Auto". Cred ca ar fi o idee buna pentru GameMode-urile Role-Play, dar si GodFather si RPG.

1. Adaugam langa celelalte "forward" urmatoarele lucruri:

Cod: Selectaţi tot

[code]forward SpalatorieMove();
forward Spalatorie1Close();
forward Spalatorie2Close();
forward ControlOn(playerid);
[/code]

2. Adaugam langa celelalte "new" urmatoarele lucruri:

Cod: Selectaţi tot

new Spalatorie1;
new Spalatorie2;
new Spalatorie3;
new Spalatorie4;
new Spalatorie5;
new Spalatorie6;
new Spalatorie7;
new Spalatorie8;
3. Adaugam langa celelalte obiecte de la "public OnGameModeInit" urmatoarele obiecte:

Cod: Selectaţi tot

Spalatorie1 = CreateObject(9833, 2458.318359375, -1461.0192871094, 13.852556228638, 0, 0, 356.03002929688);
Spalatorie2 = CreateObject(9833, 2448.8935546875, -1460.9881591797, 13.777557373047, 0, 0, 356.02844238281);
Spalatorie3 = CreateObject(9833, 2453.1083984375, -1461.0013427734, 13.82755279541, 0, 0, 356.02844238281);
Spalatorie4 = CreateObject(9833, 2453.7084960938, -1478.5186767578, 26.952545166016, 0, 89.325073242188, 95.730041503906);
Spalatorie5 = CreateObject(1698, 2445.599609375, -1459.7998046875, 22, 0, 0, 271.99951171875);
Spalatorie6 = CreateObject(1698, 2442.3994140625, -1459.8994140625, 22, 0, 0, 271.99951171875);
Spalatorie7 = CreateObject(1698, 2445.599609375, -1462.2998046875, 22, 0, 0, 271.99951171875);
Spalatorie8 = CreateObject(1698, 2442.5, -1462.3994140625, 22, 0, 0, 271.99951171875);
4. Adaugam langa celelalte Comenzi urmatoarea comanda:

Cod: Selectaţi tot

if(strcmp(cmdtext, "/wash", true) == 0)
{
if(PlayerToPoint(3.0, playerid, 2442.1116,-1461.3342,24.0000))
{
new carid = GetPlayerVehicleID(playerid);
TogglePlayerControllable(playerid, 0);
MoveObject(Spalatorie1, 2458.318359375, -1461.0192871094, 19.677570343018, 5.5);
MoveObject(Spalatorie2, 2448.8935546875, -1460.9873046875, 19.677574157715, 5.5);
MoveObject(Spalatorie3, 2453.1083984375, -1461.0009765625, 19.677558898926, 5.5);
MoveObject(Spalatorie4, 2453.287109375, -1468.4273681641, 26.952545166016, 5.5);
MoveObject(Spalatorie5, 2445.6000976563, -1459.8000488281, 22.89999961853, 2.0);
MoveObject(Spalatorie6, 2442.3999023438, -1459.9000244141, 22.89999961853, 2.0);
MoveObject(Spalatorie7, 2445.6000976563, -1462.3000488281, 22.89999961853, 2.0);
MoveObject(Spalatorie8, 2442.5, -1462.4000244141, 22.89999961853, 2.0);
SetTimer("Spalatorie1Close", 15000, 0);
SetTimer("SpalatorieMove", 2000, 0);
SetTimerEx("ControlOn", 10000, 0, "i", playerid);
SendClientMessage(playerid, COLOR_WHITE, "You paid 1.000$ spalatorier to the car wash movies");
GameTextForPlayer(playerid, "~w~-~r~1.000~g~$", 5000, 1);
GivePlayerMoney(playerid,-1000);
SetVehiclePos(carid,2444.7300,-1461.2626,23.7271);
SetVehicleZAngle(carid, 271.8910);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not the Laundry");
return 1;
}
}
5. Adaugam la Sfarsitul GameMode-ului urmatoarele lucruri:

Cod: Selectaţi tot

public ControlOn(playerid)
{
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~w~The vehicle is clean", 5000, 4);
return 1;
}


public Spalatorie1Close()
{
MoveObject(Spalatorie1, 2458.318359375, -1461.0192871094, 13.852556228638, 3.5);
MoveObject(Spalatorie2, 2448.8935546875, -1460.9881591797, 13.777557373047, 3.5);
MoveObject(Spalatorie3, 2453.1083984375, -1461.0013427734, 13.82755279541, 3.5);
MoveObject(Spalatorie4, 2453.7084960938, -1478.5186767578, 26.952545166016, 3.5);
return 1;
}


public SpalatorieMove()
{
MoveObject(Spalatorie5, 2471, -1459.6999511719, 22.89999961853, 2.5);
MoveObject(Spalatorie6, 2467.8000488281, -1459.7998046875, 22.89999961853, 2.5);
MoveObject(Spalatorie7, 2471, -1462.2998046875, 22.89999961853, 2.5);
MoveObject(Spalatorie8, 2467.8000488281, -1462.3994140625, 22.89999961853, 2.5);
SetTimer("Spalatorie2Close", 10000, 0);
return 1;
}


public Spalatorie2Close()
{
SetObjectPos(Spalatorie5, 2445.599609375, -1459.7998046875, 22);
SetObjectPos(Spalatorie6, 2442.3994140625, -1459.8994140625, 22);
SetObjectPos(Spalatorie7, 2445.599609375, -1462.2998046875, 22);
SetObjectPos(Spalatorie8, 2442.5, -1462.3994140625, 22);
return 1;
}
[/b][/i]

Înapoi la “Tutoriale”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator