[Help] With (playername) enter the server - 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] With (playername) enter the server (
/showthread.php?tid=213685)
[Help] With (playername) enter the server -
wizzi - 19.01.2011
Hey i need help with when someone get in server to show
(playername) joined the server ,
when someone leave
(playername) has left the server (Leaving)
when someone crash
(playername) has left the server (Timeout)

Re: [Help] With (playername) enter the server -
Mikkel_Pedersen - 19.01.2011
https://sampwiki.blast.hk/wiki/OnPlayerConnect
https://sampwiki.blast.hk/wiki/OnPlayerDisconnect
Re: [Help] With (playername) enter the server -
Elviss - 19.01.2011
This add to
pawn Код:
public OnPlayerConnect(playerid)
pawn Код:
new pName[MAX_PLAYER_NAME];
new joined[256];
GetPlayerName(playerid, pName, sizeof(pName));
format(joined, sizeof(joined), "%s joined the server.", pName);
SendClientMessageToAll(0x9EC73DAA, joined);
return 1;
}
And this
pawn Код:
public OnPlayerDisconnect(playerid, reason)
pawn Код:
new pName[MAX_PLAYER_NAME];
new leaving[256];
TextDrawHideForPlayer(playerid, TextWebsite);
GetPlayerName(playerid, pName, sizeof(pName));
switch(reason)
{
case 0: format(leaving, sizeof(leaving), "%s has left the server (Timeout)", pName);
case 1: format(leaving, sizeof(leaving), "%s has left the server (Leaving) ", pName);
case 2: format(leaving, sizeof(leaving), "%s has left the server (Kicking/Banned) ", pName);
}
SendClientMessageToAll(0xAA3333AA, leaving);
Re: [Help] With (playername) enter the server -
wizzi - 19.01.2011
can u explain me whare to put .. or make it full in 1 pawn code ?
Re: [Help] With (playername) enter the server -
Niki... - 19.01.2011
Go in your server gamemode and do ctrl+f and write public OnPlayerConnect and c/p this than same for public OnPlayerDisconnect if u don't know scripting go on samp wiki or here on forum and learn scripting basics
Re: [Help] With (playername) enter the server -
Elviss - 19.01.2011
try this
http://pastebin.com/PGZwX4RK
Re: [Help] With (playername) enter the server -
wizzi - 19.01.2011
pawn Код:
public OnPlayerConnect(playerid)
{
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
if(Security != 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Host has broken one of the Agreement rules, action has been taken.");
Kick(playerid);
return 1;
}
i have this , if i remove it i get too many errors i need help what to do
Re: [Help] With (playername) enter the server -
Sascha - 19.01.2011
there are brackets missing...
use this:
pawn Код:
public OnPlayerConnect(playerid)
{
new plname[MAX_PLAYER_NAME];
GetPlayerName(playerid, plname, sizeof(plname));
if(Security != 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Host has broken one of the Agreement rules, action has been taken.");
Kick(playerid);
return 1;
}
return 1;
}