[HELP] Score Save add in GM whitout register or login - 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: [HELP] Score Save add in GM whitout register or login (
/showthread.php?tid=67063)
[HELP] Score Save add in GM whitout register or login -
RyDeR` - 26.02.2009
Hi, Can anybody help me to add score save in my GM whitout /register, /login etc...
I've tried 1000 times on OnPlayerConnect and OnPlayerDisconnect but it does not succeed.
Please Help
Re: [HELP] Score Save add in GM whitout register or login -
SpiderPork - 26.02.2009
What do you mean? Explain more, please.
Re: [HELP] Score Save add in GM whitout register or login -
RyDeR` - 26.02.2009
So i want to save score whitout /register or /login.
For Example: I killed 5 people than i've 5 Score points i want to save them when i left the server.
How must i do that?
Re: [HELP] Score Save add in GM whitout register or login -
SpiderPork - 26.02.2009
You have to use a /register command to save the stats in a file.
Re: [HELP] Score Save add in GM whitout register or login -
RyDeR` - 26.02.2009
Quote:
Originally Posted by ʞɹod ɹǝpıds || SpiderPork
You have to use a /register command to save the stats in a file.
|
Hmm... But Doesn't it be going to without?
I tried this code:
Код:
public OnPlayerDisconnect(playerid)
{
new pname[MAX_PLAYER_NAME];
new Destination[256];
new Logged[MAX_PLAYERS];
GetPlayerName(playerid, pname, sizeof(pname));
format(Destination,sizeof(Destination),"\\Users\\%s.ini",pname);
if (dini_Exists(Destination) && Logged[playerid])
{
dini_IntSet(Destination,"Score", GetPlayerScore(playerid));
}
}
But it doesn't works!
Re: [HELP] Score Save add in GM whitout register or login -
pspleo - 26.02.2009
Quote:
Originally Posted by ʞɹod ɹǝpıds || SpiderPork
You have to use a /register command to save the stats in a file.
|
You don't, duh.
ToD: Search the forums for a register and login filterscript. Copy all the content to your gamemode. Then place OnPlayerRegister in OnPlayerConnect (but do a file name check with player name, and if so take OnPlayerLogin). Easy.
Leopard
EDIT:
Quote:
Originally Posted by ToD
Код:
public OnPlayerDisconnect(playerid)
{
new pname[MAX_PLAYER_NAME];
new Destination[256];
new Logged[MAX_PLAYERS];
GetPlayerName(playerid, pname, sizeof(pname));
format(Destination,sizeof(Destination),"\\Users\\%s.ini",pname);
if (dini_Exists(Destination) && Logged[playerid])
{
dini_IntSet(Destination,"Score", GetPlayerScore(playerid));
}
}
|
1) You don't need 256 as string size
2) I think \\ is wrong, try \ only
3) What happends if the file name doesn't exist? (name not registered) You gotta create the file.
Re: [HELP] Score Save add in GM whitout register or login -
RyDeR` - 26.02.2009
Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by ʞɹod ɹǝpıds || SpiderPork
You have to use a /register command to save the stats in a file.
|
You don't, duh.
ToD: Search the forums for a register and login filterscript. Copy all the content to your gamemode. Then place OnPlayerRegister in OnPlayerConnect (but do a file name check with player name, and if so take OnPlayerLogin). Easy.
Leopard
EDIT:
Quote:
Originally Posted by ToD
Код:
public OnPlayerDisconnect(playerid)
{
new pname[MAX_PLAYER_NAME];
new Destination[256];
new Logged[MAX_PLAYERS];
GetPlayerName(playerid, pname, sizeof(pname));
format(Destination,sizeof(Destination),"\\Users\\%s.ini",pname);
if (dini_Exists(Destination) && Logged[playerid])
{
dini_IntSet(Destination,"Score", GetPlayerScore(playerid));
}
}
|
1) You don't need 256 as string size
2) I think \\ is wrong, try \ only
3) What happends if the file name doesn't exist? (name not registered) You gotta create the file.
|
Ok, I'm gonna try it
Re: [HELP] Score Save add in GM whitout register or login -
RyDeR` - 26.02.2009
Hi Leopard i found a Register and Login Script
http://pastebin.com/f3f4a315a
Is these Aight?
Re: [HELP] Score Save add in GM whitout register or login -
RyDeR` - 26.02.2009
It's alright
it works thanks to all