Custom /report problem
#1

Well I'm trying to make it so when you /report you have to do /report admin name text.

At the moment, if you just do "/report" it sends the help message, but if you put anything else after "/report" it says Unknown Command.

Код:
if(strcmp(cmd, "/report", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(JustReported[playerid] == 1)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "Wait 10 seconds after sending a next report!");
	            return 1;
	        }
	       	giveplayerid = ReturnUser(tmp);
			GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		 	GetPlayerName(playerid, sendername, sizeof(sendername));
		 	if(AdminDutyStatus[giveplayerid] = 0)
			{
				SendClientMessage(playerid, COLOR_WHITE,"That admin is not on duty! See /admins");
				return 1;
			}
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[96];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "[Help] /report [admin name] [text]");
				return 1;
			}
			JustReported[playerid] = 1;
			SetTimerEx("ReportReset", 10000, false, "i", playerid);
			format(string, sizeof(string), "Report from [%d]%s: %s",playerid, sendername, (result));
			SendClientMessage(giveplayerid,COLOR_LIGHTYELLOW,string);
			SendClientMessage(playerid, COLOR_YELLOW, "Your Report Message was sent to the Admins.");
	    }
	    return 1;
	}
It's meant to send a message to giveplayerid and the message is meant to be the Result.
Reply
#2

You're "Scripting for free & Paypal money" and creating a Roleplay gamemode from scratch using low efficent codes such as strcmp w/ strtok? Its 2011!!! ZCMD, YCMD and sscanf are here and you bother to just simply use perhaps copied code if you're not knowing what you're doing...

Sorry but yeah, I might of not helped you but keep your gamemode fast & efficient will you?
Reply
#3

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
You're "Scripting for free & Paypal money" and creating a Roleplay gamemode from scratch using low efficent codes such as strcmp w/ strtok? Its 2011!!! ZCMD, YCMD and sscanf are here and you bother to just simply use perhaps copied code if you're not knowing what you're doing...

Sorry but yeah, I might of not helped you but keep your gamemode fast & efficient will you?
Everything I request in Scripting Discussion is with the gamemode I use for my community, Real Roleplay. I'm scripting a gamemode from scratch for another community and it's using ZCMD. I do only request little help for that, and everything I publicly released is using ZCMD. So please, shut up.
Reply
#4

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Everything I request in Scripting Discussion is with the gamemode I use for my community, Real Roleplay. I'm scripting a gamemode from scratch for another community and it's using ZCMD. I do only request little help for that, and everything I publicly released is using ZCMD. So please, shut up.
Though if you don't know whats wrong with your command you clearly don't know what you coded this may result to us that you have copied it, at least admit it..

EDIT: If you want a fix, (AND you're using a EDIT of a rp gm) Find that gm you used and replace it with the one in the GM...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)