adm chat.
#1

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)