SA-MP Forums Archive
How to put a sender name at end of this command - 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: How to put a sender name at end of this command (/showthread.php?tid=219024)



How to put a sender name at end of this command - Matej_ - 31.01.2011

pawn Code:
if(!strcmp(cmdtext, "/advertise", true, 10))
    {
    if(IsPlayerInRangeOfPoint(playerid, 7.0, 362.5211,173.6900,1008.3828))
    {
        new string[248];
        format(string, sizeof string, "*** Advertisement: %s ***", cmdtext[11]);
        SendClientMessageToAll(0x008000FF, string);
        GivePlayerMoney(playerid,-1000);
        return 1;
    }
It needs to look like this:

*** Advertisement: Selling infernus for 50,000$. - Matej_ ***


Re: How to put a sender name at end of this command - Franck_ - 31.01.2011

pawn Code:
if(!strcmp(cmdtext, "/advertise", true, 10))
    {
    if(IsPlayerInRangeOfPoint(playerid, 7.0, 362.5211,173.6900,1008.3828))
    {
        new string[248],pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,sizeof(pName));
        format(string, sizeof string, "*** Advertisement: %s [ Contact %s ]***", cmdtext[11],pName);
        SendClientMessageToAll(0x008000FF, string);
        GivePlayerMoney(playerid,-1000);
        return 1;
    }