[HELP] Include OnPlayerConnect & OnPlayerDisconnect
#1

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"
Reply
#2

Create Your own
Код:
ToD_OnPlayerConnect
ToD_OnPlayerDisconnect
:P
Reply
#3

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

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)
Reply
#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
#6

Quote:

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

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

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
Reply
#8

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
Reply
#9

lol
Reply
#10

ToD_OnPlayerConnect and ToD_OnPlayerDissconnect does not work

It will not create an account in Scriptfiles.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)