Hello I'm new in forum need help
#1

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

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

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

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

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

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

Thanks All;+rep to all
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)