[HELP] Include OnPlayerConnect & OnPlayerDisconnect
#5

What's Wrong?

Код:
/*x---------------------------------Important-------------------------------------x*/
//**INCLUDES**//
#include <dini>
//**PRAGMAS**//
#pragma tabsize 0
#pragma unused ret_memcpy
//**MISC**//
//native ToD_OnPlayerConnect(playerid);
//native ToD_OnPlayerDisconnect(playerid, reason);
/*x---------------------------------Defining-------------------------------------x*/
//**COLORS*//
/*
#define GREEN 			0x21DD00FF
#define RED 			0xE60000FF
#define ADMIN_RED 		0xFB0000FF
#define YELLOW 			0xFFFF00FF
#define ORANGE 			0xF97804FF
#define LIGHTRED 		0xFF8080FF
#define LIGHTBLUE 	
0x00C2ECFF
#define PURPLE 			0xB360FDFF
#define PLAYER_COLOR 	0xFFFFFFFF
#define BLUE 			0x1229FAFF
#define LIGHTGREEN 		0x38FF06FF
#define DARKPINK 		0xE100E1FF
#define DARKGREEN 		0x008040FF
#define ANNOUNCEMENT 	0x6AF7E1FF
#define COLOR_SYSTEM 	0xEFEFF7AA
#define GREY 			0xCECECEFF
#define PINK 			0xD52DFFFF
#define DARKGREY  	0x626262FF
#define AQUAGREEN  	0x03D687FF
#define NICESKY 		0x99FFFFAA
#define WHITE 			0xFFFFFFFF*/
// **FORWARDS** //
native ToD_OnPlayerConnect(playerid);
native ToD_OnPlayerDisconnect(playerid, reason);
/*x---------------------------------CallBacks-------------------------------------x*/
ToD_OnPlayerConnect(playerid)
{
	new pname[MAX_PLAYER_NAME]; new oyunism[48];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(oyunism, sizeof(oyunism), "/Score/%s.ini",pname);
	if(!dini_Exists(oyunism))
	{
	dini_Create(oyunism);
	dini_IntSet(oyunism, "score", 0);
	SetPlayerScore(playerid, dini_Int(oyunism, "Score"));
	}
	else
	{
	SetPlayerScore(playerid, dini_Int(oyunism, "Score"));
 	}
	return 1;
}

ToD_OnPlayerDisconnect(playerid, reason)
{
  	new pname[MAX_PLAYER_NAME]; new oyunism[48];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(oyunism, sizeof(oyunism), "/Score/%s.ini",pname);
	if(!dini_Exists(oyunism))
	{
	}
	else
	{
	dini_IntSet(oyunism, "Score", GetPlayerScore(playerid));
	}
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)