SA-MP Forums Archive
[HELP] Include OnPlayerConnect & OnPlayerDisconnect - 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] Include OnPlayerConnect & OnPlayerDisconnect (/showthread.php?tid=67844)



[HELP] Include OnPlayerConnect & OnPlayerDisconnect - RyDeR` - 04.03.2009

Hi, I'm creating an include but i need OnPlayerConnect and OnPlayerDisconnect when I use these it will give a error:
How to use an other OnPlayerConnect Please help

Код:
C:\DOCUME~1\ISMAIL~1\MIJNDO~1\Server\GAMEMO~1\zvdm.pwn(133) : error 021: symbol already defined: "OnPlayerConnect"
C:\DOCUME~1\ISMAIL~1\MIJNDO~1\Server\GAMEMO~1\zvdm.pwn(143) : error 021: symbol already defined: "OnPlayerDisconnect"



Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - Jefff - 04.03.2009

Create Your own
Код:
ToD_OnPlayerConnect
ToD_OnPlayerDisconnect
:P


Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - RyDeR` - 04.03.2009

But it does not work :S
When I join the server


Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - ғαιιοцт - 04.03.2009

Quote:
Originally Posted by ToD
But it does not work :S
When I join the server
make sure that you call ToD_OnPlayerConnect and ToD_OnPlayerDisconnect in your gm/fs (where you include it)
this basically just calls your own function (like onplayerconnect function) at the same moment as the real onplayerconnect with the same parameters (playerid)


Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - RyDeR` - 04.03.2009

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));
	}
}



Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - ғαιιοцт - 04.03.2009

Quote:

// **FORWARDS** //
native ToD_OnPlayerConnect(playerid);
native ToD_OnPlayerDisconnect(playerid, reason);

must be
Код:
// **FORWARDS** //
forward ToD_OnPlayerConnect(playerid);
forward ToD_OnPlayerDisconnect(playerid, reason);



Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - RyDeR` - 04.03.2009

Quote:
Originally Posted by °ғαιιοцт°
Quote:
Originally Posted by ToD
But it does not work :S
When I join the server
make sure that you call ToD_OnPlayerConnect and ToD_OnPlayerDisconnect in your gm/fs (where you include it)
this basically just calls your own function (like onplayerconnect function) at the same moment as the real onplayerconnect with the same parameters (playerid)
Al Right but i want whitout


Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - ғαιιοцт - 04.03.2009

Quote:
Originally Posted by ToD
Quote:
Originally Posted by °ғαιιοцт°
Quote:
Originally Posted by ToD
But it does not work :S
When I join the server
make sure that you call ToD_OnPlayerConnect and ToD_OnPlayerDisconnect in your gm/fs (where you include it)
this basically just calls your own function (like onplayerconnect function) at the same moment as the real onplayerconnect with the same parameters (playerid)
Al Right but i want whitout
I don't think that's possible


Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - RyDeR` - 04.03.2009

lol


Re: [HELP] Include OnPlayerConnect & OnPlayerDisconnect - RyDeR` - 04.03.2009

ToD_OnPlayerConnect and ToD_OnPlayerDissconnect does not work

It will not create an account in Scriptfiles.