SA-MP Forums Archive
OnPlayerConnect Does not work. - 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: OnPlayerConnect Does not work. (/showthread.php?tid=228567)



OnPlayerConnect Does not work. - Shetch - 19.02.2011

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.


Re: OnPlayerConnect Does not work. - rjjj - 19.02.2011

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


Re: OnPlayerConnect Does not work. - AK47317 - 19.02.2011

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?


Re: OnPlayerConnect Does not work. - WillyP - 19.02.2011

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.


Re: OnPlayerConnect Does not work. - AK47317 - 19.02.2011

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


Re: OnPlayerConnect Does not work. - WillyP - 19.02.2011

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.


Re: OnPlayerConnect Does not work. - AK47317 - 19.02.2011

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 ? )