SA-MP Forums Archive
adm chat. - 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: adm chat. (/showthread.php?tid=83798)



adm chat. - Dreftas - 27.06.2009

pawn Код:
if(strcmp(cmd, "//", true) == 0)
    {
        if(pInfo[playerid][AdminLvl] < 1)
            return 0;
           
        new tmp[256];
        tmp = strtok(cmdtext, idx);
       
        new AdminName[MAX_PLAYER_NAME], AdminText[128], AdminTextLog[257];
        GetPlayerName(playerid,AdminName,sizeof(AdminName));
        format(AdminText,sizeof(AdminText),"%s: %s",AdminName,tmp);
       
        SendClientMessageToAdmins(0xA954FFFF,AdminText);
        samp_mysql_real_escape_string(AdminText,AdminTextLog);
       
       
        format(param,128,"AdminChat: %s",AdminTextLog);
        LogPlayerCmd(playerid, -1, param, true);
        return 1;
    }
Only works if i write // oneword
if i write more than one word, it shows only one word, how to fix?


Re: adm chat. - Grim_ - 27.06.2009

Change
pawn Код:
tmp = strtok(cmdtext, idx);
to
pawn Код:
tmp = bigstrtok(cmdtext, idx);
And get the bigstrtok function ont he forums.