[Help] With (playername) enter the server
#1

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

https://sampwiki.blast.hk/wiki/OnPlayerConnect
https://sampwiki.blast.hk/wiki/OnPlayerDisconnect
Reply
#3

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);
Reply
#4

can u explain me whare to put .. or make it full in 1 pawn code ?
Reply
#5

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

try this
http://pastebin.com/PGZwX4RK
Reply
#7

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)