SA-MP Forums Archive
[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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] (/showthread.php?tid=267818)



[Help] - Twinki1993 - 10.07.2011

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?



Re: [Help] - SmileyForCheat - 10.07.2011

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



Re: [Help] - Twinki1993 - 10.07.2011

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


Re: [Help] - SmileyForCheat - 10.07.2011

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



Re: [Help] - Twinki1993 - 10.07.2011

Workssssssssss thankssssssssssss


Re: [Help] - SmileyForCheat - 10.07.2011

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