[Help]
#1

I need help with this..

When I want like to get player name, I want of it to be like "%s" for name

So basically when I am scripting I want this

SendClientMessage(playerid, COLOR_YELLOW, "%s Welcome");
So at the end it shoud look like this
When you type some command like /welcome it says
"Twinki Welcome!" I mean playername if is Twinki
How to do this?
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        new pName[MAX_PLAYER_NAME], str[128]; //Overused cells
        GetPlayerName(playerid, pName, sizeof(pName));
    if (strcmp("/welcome", cmdtext, true, 10) == 0) //twinki
    {
format(str, 128, "Welcome %s!", pName); //Welcome Twinki
SendClientMessage(playerid, 0xFFFFFFAA, str);
        return 1;
        }
Reply
#3

I want it for on player connect too, I jus made example for CMD
Reply
#4

pawn Код:
public OnPlayerConnect(playerid)
{
        new pName[MAX_PLAYER_NAME], str[128]; //Overused cells
        GetPlayerName(playerid, pName, sizeof(pName));

        format(str, 128, "Welcome %s!", pName); //Welcome Twinki
        SendClientMessage(playerid, 0xFFFFFFAA, str);
        return 1;
}
Reply
#5

Workssssssssss thankssssssssssss
Reply
#6

Quote:
Originally Posted by Twinki1993
Посмотреть сообщение
Workssssssssss thankssssssssssss
You'r Welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)