28.05.2015, 11:45
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):
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.
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
Just tell me if i should post more things.
I think it is missing something so just reply as this obviously is not working.