#1

Okey i need some help i hope some one will help me.
i downloaded a server, in this server will load the owned vehicle when player connect and when player disconnect the owned vehicle will destroy to avoid lagging.
This kinda non-rp.
what i want is when i start the server, all owned vehicles be loaded.
i need to use InGameModeInit but idk how.

i have this code in "stock loadchar" < this like onplayerconnect.

pawn Код:
if(PlayerInfo[playerid][vModel])
    {
        PlayerInfo[playerid][pVeh] = CreateVehicle(PlayerInfo[playerid][vModel], PlayerInfo[playerid][vX],PlayerInfo[playerid][vY],PlayerInfo[playerid][vZ],PlayerInfo[playerid][vA],PlayerInfo[playerid][vC1],PlayerInfo[playerid][vC2],32000);
        ChangeVehiclePaintjob(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vPJ]);
        if(PlayerInfo[playerid][vLocked]) SetVehicleParamsEx(PlayerInfo[playerid][pVeh], 0, 0, 0, 1, 0, 0, 0);
        SetVehicleNumberPlate(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehPlate]);
        for(new i=0; i<14; i++)
        {
            AddVehicleComponent(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehMod][i]);
        }
    }
What i should do to make it when InGameModeInIt the owned vehicles will be loaded.
Reply
#2

Is it Y_ini or MySQL and if MySQL then what version of MySQL..?
Reply
#3

Y_ini.
( y_ini is ysi right lel? )
i found this #include <YSI\y_ini>
Reply
#4

For this you need to loop through all user files OnGameModeInIt and load data and createvehicle.
BUT sadly currently it is impossible to get listing of files/directory through the natives that current SA-MP provides, for achieving this you need a file management plugin which supports directory/file listing functions
Here I found a list of File management plugins from Plugin List topic :
Reply
#5

i didn't get it comletely.
what i need to do is copy all loadchar to ongamemodeinit.
and download all this links to be able to create files

EDIT: just add this "LoadChar()" to ongamemodeinit ?
Reply
#6

i can't make file to save vehicles?
tell me what is the problem...
Reply
#7

Bump
Reply
#8

Bump, what is the soluation?
Reply
#9

Alright,

You are saying that you are using Y_INI for loading/saving, well you cannot do a loop for all files, this will be quite easy in MySQL, but according to your system it's sort of 'impossible'.

To make this possible, I suggest re-creating the vehicles system and make it separated from the player.

I hope I helped
Reply
#10

i'm using Y_INI for alot of things, not only vehicles.
so i can use y_ini to another things and vehicle system for mysql?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)