OnPlayerConnect Does not work.
#1

Hi guys.

So basicaly my OnPlayerConnect doesn't work.

My script:
Код:
public OnPlayerConnect(playerid)
{
	SendClientMessage(playerid, COLOR_BRIGHTRED, "Wellcome to my server...");
	return 1;
}
It just doesn't do anything when player connects. What could be the problem?
It would help a lot if someone would respond.. please.
Reply
#2

Some gamemodes with much lines do not accept functions like TextDrawShowForPlayer and ShowPlayerDialog when it is in OnPlayerConnect callback.

Just put your codes in OnPlayerRequestClass it is like OnPlayerConnect with little diferences.

pawn Код:
public OnPlayerRequestClass(playerid)
{
    return 1;
}
I hope that i have helped
Reply
#3

pawn Код:
public OnPlayerConnect(playerid)
{
 new str[128], str2[128], pName[MAX_PLAYER_NAME];
 GetPlayerName(playerid, pName, sizeof(pName));
 format(str, sizeof(str), "%s Has Joined The Server", pName);
 SendClientMessageToAll(0xFFFFFFFF, str);
 format(str2, sizeof(str2), "Welcome To My Server");
 SendClientMessage(playerid, 0xFFFFFFFF, str2);
 return 0;
}
like this son?
Reply
#4

Quote:
Originally Posted by AK47317
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
 new str[128], str2[128], pName[MAX_PLAYER_NAME];
 GetPlayerName(playerid, pName, sizeof(pName));
 format(str, sizeof(str), "%s Has Joined The Server", pName);
 SendClientMessageToAll(0xFFFFFFFF, str);
 format(str2, sizeof(str2), "Welcome To My Server");
 SendClientMessage(playerid, 0xFFFFFFFF, str2);
 return 0;
}
RETURN THE FUCKING 1, NOT 0.
Reply
#5

hmm is it true? cuz i use all return 0; in OnPlayerConnect callback r 0...
Reply
#6

Quote:
Originally Posted by AK47317
Посмотреть сообщение
hmm is it true? cuz i use all return 0; in OnPlayerConnect callback r 0...
lrn2code? Return 1 = true, return 0 = false.
Reply
#7

i know that sh1t does, but love return 0 more dunno if its work a lot on other shizzle

ps: how come u become so mad of me? ( jealous ? )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)