SA-MP Forums Archive
Hello I'm new in forum need help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Hello I'm new in forum need help (/showthread.php?tid=599524)



Hello I'm new in forum need help - RedRex - 26.01.2016

Hello all I want say how to put as that ingame

RedRex's connted to server [Joined] and this

RedRex's has quit tthe server [Leving]

And Sure I want that colors in joined. Levaing


Re: Hello I'm new in forum need help - itsCody - 26.01.2016

Wrong section, and use OnPlayerConnect and OnPlayerDisconnect to send those messages.


Re: Hello I'm new in forum need help - Phar - 26.01.2016

https://sampwiki.blast.hk/wiki/Creating_...Leave_Messages
change SendClientMessageToAll(0xAAAAAAAA, string); (0xAAAAAAAA) with the color u want


Re: Hello I'm new in forum need help - MicroKyrr - 27.01.2016

It's too simple. I will give u an example with a colorful/multiple color message!

On player connect
Code:
public OnPlayerConnect(playerid)
{
    new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "{FF6600}%s{66FF00} has joined the server! {00FFFF}[Joined]", pname);
    SendClientMessageToAll(0x00ff33FF, string);
    return 1;
}
On player disconnect

Code:
public OnPlayerDisconnect(playerid, reason)
{
    new pname[MAX_PLAYER_NAME], string[100 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname)); 
    switch(reason)
    {
        case 0: format(string, sizeof(string), "{FF6600}%s{FF0000} has left the server. {00FFFF}[Timeout]", pname);
        case 1: format(string, sizeof(string), "{FF6600}%s{FF0000} has left the server. {00FFFF}[Leaving]", pname);
        case 2: format(string, sizeof(string), "{FF6600}%s{FF0000} has left the server. {00FFFF}[Kicked/Banned]", pname);
    } 
    SendClientMessageToAll(0xff0000FF, string);
    return 1;
}



Re: Hello I'm new in forum need help - amirm3hdi - 27.01.2016

You ask for help here... NOT SCRIPS

When a player connects OnPlayerConnect() get's called and you should get the player name then use SendClientMassageToAll() to alert everyone...
You'll need to do the same with OnPlayerDisconnect(),

Find all the functions on SA-MP Wiki then use'em.


Re: Hello I'm new in forum need help - MicroKyrr - 27.01.2016

Quote:
Originally Posted by MicroKyrr
View Post
I will give u an example with a colorful/multiple color message!
I only give him an example , as you can see he's new here.

On Topic:

Related functions for Creating Join and leave messsages.

https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/SendClientMessage / https://sampwiki.blast.hk/wiki/SendClientMessageToAll
https://sampwiki.blast.hk/wiki/Format

https://sampwiki.blast.hk/wiki/Creating_...Leave_Messages


Re: Hello I'm new in forum need help - RedRex - 27.01.2016

Thanks All;+rep to all


Re: Hello I'm new in forum need help - amirm3hdi - 27.01.2016

Quote:
Originally Posted by RedRex
View Post
Thanks All;+rep to all
BTW, it's not Levaing, it's Leaving*

Also, when a player quits, it means already Left.
So if you use left, makes more sense.