SA-MP Forums Archive
Cant Speak if Not Logged In HELP - 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)
+--- Thread: Cant Speak if Not Logged In HELP (/showthread.php?tid=390987)



Cant Speak if Not Logged In HELP - ShawtyyMacJunior - 09.11.2012

This is performed in almost every server in SAMP. Im also looking to input this into my server. Only problem is that I have no clue on how to make this code. Could someone refer me to a website that will help me or just be kind enough to just help me now? Thanks

- I am Experienced! Even I need help sometimes...


Re: Cant Speak if Not Logged In HELP - Abreezy - 09.11.2012

pawn Код:
new pLogged[MAX_PLAYERS];
On successful login do:

pawn Код:
pLogged[playerid] = 1;
Then do this:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    if(pLogged == 1)
    {
        format(string, sizeof(string), "%s says %s", name, text);
        SendClientMessageToAll(-1, string);
    }
    else
    {
             SendClientMessage(playerid, -1, "You must be logged in to talk!");
    }
    return 0;
}