[HELP] Score Save add in GM whitout register or login
#7

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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)