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(playerid, cmdtext[], success)
{
if(!success) return SendClientMessage(playerid, COLOR_WHITE, INVALID_CMD);
new commandFile[128], d, m, y;
getdate(y, m, d);
format(commandFile, sizeof(commandFile), "Command-logs/Command-logs-%02d-%02d-%d.log", d, m, y);
new File:cmdlog = fopen(commandFile, io_readwrite);
if(cmdlog)
{
new str[156];
format(str, sizeof(str), "%s - %s, %s\n",TimeDate(), PlayerName(playerid), cmdtext);
printf("%s", str);
fwrite(cmdlog, str);
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];