SA-MP Forums Archive
OnPlayerCommandPerformed - Last character - 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)
+--- Thread: OnPlayerCommandPerformed - Last character (/showthread.php?tid=591290)



OnPlayerCommandPerformed - Last character - d3ll - 10.10.2015

It's not showing the last character of the command, is this known or...?

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success) return SendClientMessage(playeridCOLOR_WHITEINVALID_CMD);
    new 
commandFile[128], dmy;
    
getdate(ymd);
    
format(commandFilesizeof(commandFile), "Command-logs/Command-logs-%02d-%02d-%d.log"dmy);
    new 
File:cmdlog fopen(commandFileio_readwrite); 
    if(
cmdlog)
    {
        new 
str[156];
        
format(strsizeof(str), "%s - %s, %s\n",TimeDate(), PlayerName(playerid), cmdtext);
        
printf("%s"str);
        
fwrite(cmdlogstr);
        
fclose(cmdlog);    
    }
    return 
1;

For example when I use the command /a -> admin chat, it will log it as '/'

Is there a way around this, or?


Re: OnPlayerCommandPerformed - Last character - Morpheine - 10.10.2015

new string[512] or new string[256];