little question - 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: little question (
/showthread.php?tid=248217)
little question -
tanush - 12.04.2011
Sometimes player stats would save but 5% when player connects, their password and name saves but not anything else like money etc, please help
Re: little question -
Anastasia - 12.04.2011
Please post the code, we are not mind readers.
Re: little question -
tanush - 12.04.2011
onplayerregister
pawn Код:
if (dialogid == 100)
{
if (dialogid == 100)
{
new name[MAX_PLAYER_NAME], file[256], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file),"myserver/%s.ini", name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return
ShowPlayerDialog(playerid, 100, DIALOG_STYLE_INPUT, "Hi your not registered", "Welcome to Extreme Stuntage!!! Register here", "Register", "Leave");
dini_Create(file);
dini_IntSet(file, "Adminlevel", PlayerData[playerid][AdminLevel] = 0);
dini_IntSet(file, "VIP",PlayerData[playerid][vip] = 0);
dini_IntSet(file, "Password", udb_hash(inputtext));
dini_IntSet(file, "Money",PlayerData[playerid][Cash] = 0); // set money
dini_IntSet(file, "Score", PlayerData[playerid][Score] = 0); // Set's score
dini_IntSet(file, "Hour",PlayerData[playerid][Hour] = 0);
dini_IntSet(file, "Minute",PlayerData[playerid][Minute] = 0);
SendClientMessage(playerid, 0xFF9900AA, string);
}
}
whenplayer log ss
pawn Код:
if (dialogid == 101)
{
new name[MAX_PLAYER_NAME],str[128], file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file),"myserver/%s.ini", name);
if(!response)
{
Kick(playerid);
format(str,sizeof(str),"%s has been kicked out for not logging in!",name);
SendClientMessageToAll(0xFF9900AA,str);
}
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 101, DIALOG_STYLE_INPUT, "Login", "You are registered, enter your password below!", "Login", "Quit");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, 0xFF0000FF, "Wrong PASSWORD sir.");
ShowPlayerDialog(playerid, 101, DIALOG_STYLE_INPUT, "Login", "You are registered, enter your password below!", "Login", "Quit");
}
else
{
PlayerData[playerid][AdminLevel] = dini_Int(file, "Adminlevel");
PlayerData[playerid][vip] = dini_Int(file, "VIP");
SetPlayerScore(playerid,dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
PlayerData[playerid][Hour] = dini_Int(file, "Hour");
PlayerData[playerid][Minute] = dini_Int(file, "Minute");
OnlineTime[playerid] = SetTimerEx("OnlineTimeUpdate",60000,true, "i", playerid);
}
return 1;
}
Re: little question -
tanush - 23.04.2011
BUMP**************
Re: little question -
tanush - 25.04.2011
*bump*
Re: little question -
tanush - 28.04.2011
bump*
Re: little question -
tanush - 01.05.2011
*bump please help, it been like 3weeks
Re: little question -
Skylar Paul - 01.05.2011
You're using a dialog under OnPlayerDisconnect, you can't do that.
Re: little question -
tanush - 01.05.2011
my bad, i mean when player loggs in(i was in a rushwhen i was posting)
Re: little question -
dillo1000 - 02.05.2011
Tanush it means they didnt register I think