Need help with this code!
#1

Hello,
Today i have made a jobsystem that save the players job after relog. The system save your job, but after relog it don't load the job. I don't now whats the problem. Here you have a little piece of my login-script that (if everything works correctly ) will load your job:
Код:
logged[playerid] = 1;
          money[playerid] = dini_Int(udb_encode(playername), "money");
          adminlevel[playerid] = dini_Int(udb_encode(playername), "adminlevel");
          job[playerid] = dini_Int(udb_encode(playername), "job");
          format(string, sizeof(string), "%s, je bent nu ingelogd. Je hebt adminlevel %d en je hebt %d dollar", playername, adminlevel[playerid], money[playerid]);
          SendClientMessage(playerid, COLOR_GREEN, string);
          GivePlayerMoney(playerid, money[playerid]);
					SetPlayerTeam(playerid, job[playerid]);

        }
      }
Have I made a mistake in this section?

Happy Christmas!
sean5874

PS: The script that save the jobs and the script that load the job are not the same!
Reply
#2

Can you also show the script that saves it?
Reply
#3

Just to verify, because you're using dini, what function are you using to SAVE it? dini_IntSet(params)?

Reply
#4

@Mademan:

Here you have the script:
Код:
if(strcmp(cmdtext, "/jobTaxi", true) == 0) {
     new pname[MAX_PLAYER_NAME];
     GetPlayerName(playerid, pname, sizeof (pname));
     format(string3, sizeof(string3), " %s is now working an taxi driver.", pname);
     SendClientMessageToAll(COLOR_GREEN, string3); //
     SetPlayerCheckpoint(playerid, 1729.9542,-1852.2616,13.5064, 4);
     SendClientMessage(playerid, TEAM_TAXI_COLOR,"Follow the marker and pick up your taxi");
     GameTextForAll(string3 ,3000,5);
     dini_IntSet(pname, "Job", 2); //the save-section
     gTeam[playerid] = TEAM_TAXI;
@Calon

yes, I use dini_Inset with a param that gets the players name.
Reply
#5

How do you know it doesn't work?
Reply
#6

pawn Код:
dini_IntSet(udb_encode(playername), "Job", 2);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)