Vehicle password saving
#1

Yes, i'm scripting a thing that you as vehicle owner can set a password to your vehicle and else players that know the password are able to drive it (and i my server earn alittle more when making missions with owned vehicles).

The problems goes there when i set pass to a vehicle > exit server > restart server > join the server > password reset to nothing ("").
I loads the password if i : set the pass to a vehicle > exit server > join server (no restart between).

I post here the save/load codes (as the commands work):

pawn Код:
//To load the pass and putting it into a variable
            if (strcmp(ParameterName, "Pass", false) == 0) // If the parametername is correct ("Pass")
        AVehicleData[vid][Pass] = strval(ParameterValue);
           
            //To save the pass from the variable
       format(LineForFile, 100, "Pass %s\r\n", AVehicleData[vid][Pass]); // Construct the line: "Pass <Pass>"
       fwrite(HFile, LineForFile); // And save it to the file
It should be apretty simple piece of coding. These lines (load and save) is in an file with other stuff about the owned vehicles susch as: color, fuel, model etc etc...

Just tell me if i should post more things.
I think it is missing something so just reply as this obviously is not working.
Reply


Messages In This Thread
Vehicle password saving - by Hessu - 28.05.2015, 11:45
Re: Vehicle password saving - by Konstantinos - 28.05.2015, 12:16
Re: Vehicle password saving - by Hessu - 28.05.2015, 14:09
Re: Vehicle password saving - by Hessu - 31.05.2015, 04:46
Re: Vehicle password saving - by Konstantinos - 31.05.2015, 11:10
Re: Vehicle password saving - by Hessu - 31.05.2015, 12:42

Forum Jump:


Users browsing this thread: 2 Guest(s)