SA-MP Forums Archive
Please help me im tired of that - 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: Please help me im tired of that (/showthread.php?tid=242316)



Please help me im tired of that - bijoyekuza - 19.03.2011

hey scripters
this is so annyoing

I want to learn sscanf and dcmd because as i saw its much more better then strtok and much more faster/shorter.

I dont want to use this long command anymore :
Код:
	if(strcmp(cmd,"/ban",true) == 0) 	{
		if(PlayerInfo[playerid][pAdminLevel] > 1)
		{
		new tmp[256],tmp2[256],adminname[MAX_PLAYER_NAME],victim,victimname[MAX_PLAYER_NAME],string[256],string2[256];
	    tmp = strtok(cmdtext, idx);
	    tmp2 = strtok(cmdtext, idx);
	    if(strlen(tmp) == 0) return SendClientMessage(playerid,COLOR_RED,": Usage : /ban [PLAYERID][REASON]");
		if(strlen(tmp2) == 0) return SendClientMessage(playerid,COLOR_RED,": Usage : /ban [PLAYERID][REASON]");
		victim = strval(tmp);
 		if(!IsPlayerConnected(victim))
	 	{
	 	notc(playerid);
	 	}
		new Year, Month, Day;
		getdate(Year, Month, Day);
		GetPlayerName(victim,victimname,sizeof(victimname));
		GetPlayerName(playerid,adminname,sizeof(adminname));
		format(string,sizeof(string),"  You have banned : %s",victimname);
		new reason[256];
  		reason = tmp2;
		if(strlen(tmp) == 1) {format(string2,sizeof(string2)," %d/%d/%d Player %s Has been banned by admin : MR.%s . Reason : %s",Year,Month,Day,victimname,adminname,cmdtext[5]);}
		if(strlen(tmp) == 2) {format(string2,sizeof(string2)," %d/%d/%d Player %s Has been banned by admin : MR.%s . Reason : %s",Year,Month,Day,victimname,adminname,cmdtext[6]);}
		if(IsPlayerConnected(victim))
		{
		SendClientMessageToAll(COLOR_RED,string2);
		Ban(strval(tmp));
                              }
I just want to make short commands with 10 lines limit
I dont want that just one little ban command will take a full script

so the problem is

whene i #include<sscanf2> in my pawno I get a crash !!!!!!!!!!!!!!!!!!



Re: Please help me im tired of that - Biesmen - 19.03.2011

I hope you entered #include <SSCANF2> instead of #iclude<sscanf2>.
That could be the reason.

Also, make sure you entered that line below #include <a_samp>.


Re: Please help me im tired of that - bijoyekuza - 19.03.2011

#include <a_samp>
#include <sscanf2>