SA-MP Forums Archive
Bug/Error saving system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Bug/Error saving system (/showthread.php?tid=84350)



Bug/Error saving system - Nmancer - 30.06.2009

Hi everybody,
I have a license system that records have been.
Codes:
Код:
(Save license)dUserSetINT(PlayerName(playerid)).("license",license[playerid]); //onplayerdisconnect
Код:
dcmd_login(playerid,params[]) {
  if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"<!> Already login");
  if (strlen(params)==0) return SystemMsg(playerid,"<!> uSe: /login <pw>");
  if (udb_CheckLogin(PlayerName(playerid),params)) {
   login[playerid]=1;
   license[playerid] = dUserINT(PlayerName(playerid)).("license")-license[playerid];
   PLAYERLIST_authed[playerid]=true;
    return SystemMsg(playerid,"<!> Success login");
  }
  return SystemMsg(playerid,"Wrong password or nickname!");
}
But sometimes deleting license (license[playerid]=0 from Player_Name.dudb.sav I do not do it


Re: Bug/Error saving system - ByFukara - 30.06.2009

if player finished driving licence

dUserSetInit("licence",1);


if player licenced and getting a car

public onplayerentervehicle

if(licence = 1);

else

SendClientMessage(playerid, You need a licence);


Note: the codes can be false. it is only a guess