logs - 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: logs (
/showthread.php?tid=589345)
logs - Whatwasit - 18.09.2015
Hello,
I wanted to know how I can get from a file with dini_Get. Only certain infromation. explanation :
[11.9.2015 23:7:32] Example has been banned by Administrator example [Reason: reason] [Date: 11/9/2015] [Time: 23:7]
I want to get only the reason in a string how can I do that ?
Thanks !
Re: logs -
saffierr - 18.09.2015
PHP код:
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
That is to define the players name
Now lets get the players name
PHP код:
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
GetPlayerName(targetplayer, pname2, MAX_PLAYER_NAME);
Now we have their names, now we have to use the format
PHP код:
format(string, sizeof string, "%s has been banned by Administrator %s", pname2, pname);
the %s is the players name. after the "," I have defined the players name.
I hope you'll understand this.
Note: You have to define the string either, but I just explained you the name part.
Edit: Oh shit lol, I just noticed you just wanted the reason.
Well that's kinda the same shit
PHP код:
if(sscanf(params, "s", reason)) return SCM(bla, bla, bla);
PHP код:
format(string, sizeof string, "%s has been banned by %s [%s]", pname2, pname, reason);