English Give a vehicle at the first connection of the player

Mathis

Admin
Membre du personnel
29/12/19
503
16
48
1 100
Welcome to this tutorial that will allow you to automatically give a vehicle at the first connection of the player ;)
This tutorial is a response to a help request from Loukas13 Loukas13.

Leeeet's goo !

In your life_server/Functions/MySQL/fn_insertRequest.sqf, add this at the end of the file :
S’il vous plaît, Connexion ou S'inscrire pour voir le code !

In your life_server/Functions/MySQL/fn_insertVehicle.sqf, replace theses lines :
S’il vous plaît, Connexion ou S'inscrire pour voir le code !
by theses :
S’il vous plaît, Connexion ou S'inscrire pour voir le code !

And replace this line :
S’il vous plaît, Connexion ou S'inscrire pour voir le code !
By this :
S’il vous plaît, Connexion ou S'inscrire pour voir le code !

BE CAREFUL WITH THIS LINE IF YOU ALREADY MODIFIED IT.
(1 was replaced by %7 and ,_active was added after _plate)

And, that's it !

Sincerely,
Forum Manager Mathis
 
  • Like
Les réactions: IceEagle132

IGS Apex

User
29/12/19
1
0
100
Welcome to this tutorial that will allow you to automatically give a vehicle at the first connection of the player ;)
This tutorial is a response to a help request from [USER = 771] @ Loukas13 [/ USER].

Leeeet's goo!

In your life_server / Functions / MySQL / fn_insertRequest.sqf , add this at the end of the file:
[CODED]
_className = "C_Van_01_transport_F";
[_uid, "civ", "Car", _ className, 0, (round (random (1000000))), 0] call DB_fnc_insertVehicle; [/ CODED]

In your life_server / Functions / MySQL / fn_insertVehicle.sqf , replace theses lines:
[CODED]
params [
"_uid",
"_side",
"_type",
"_className",
["_color", - 1, [0]],
["_plate", - 1, [0]]
]; [/ CODED]
by theses:
[CODED]
params [
"_uid",
"_side",
"_type",
"_className",
["_color", - 1, [0]],
["_plate", - 1, [0]],
["_active", 1, [0]]
]; [/ CODED]

And replace this line:
[CODED]
_query = format ["INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear, damage) VALUES ('% 1', '% 2', '% 3', '% 4 ',' 1 ',' 1 ',' "" [[], 0] "" ','% 5 ','% 6 ',' "" [] "" ',' "" [] "" ') ", _ side, _className, _type, _uid, _color, _plate]; [/ CODED]
By this:
[CODED]
_query = format ["INSERT INTO vehicles (side, classname, type, pid, alive, active, inventory, color, plate, gear, damage) VALUES ('% 1', '% 2', '% 3', '% 4 ',' 1 ','% 7 ',' "" [[], 0] "" ','% 5 ','% 6 ',' "" [] "" ',' "" [] " "')", _ side, _className, _type, _uid, _color, _plate, _active]; [/ CODED]

BE CAREFUL WITH THIS LINE IF YOU ALREADY MODIFIED IT.
(1 was replaced by % 7 and , _active was added after _plate)

And, that's it!

Sincerely,
Forum Manager Mathis
Any chance you can make so when someone connects for the first time they get a random "Land_i_Stone_HouseSmall_V1_F" house on the map and spawn at it?
 
Activité
Pour l'instant, il n'y a personne ici