Funny error
#1

Don't ask what was the problem in the first place
Код:
	if(strcmp(cmd, "/amega", true) == 0 || strcmp(cmd, "/amegaphone", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerInfo[playerid][pAdmin] >= 1)
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /amega(phone) [text]");
				return 1;
			}
			new amount;
			amount = strval(tmp);

			PlayerInfo[playerid][pAMega] = amount;
			format(string, sizeof(string), " Your Admin Megaphone Prefix is now %d.", amount);
			SendClientMessage(playerid, COLOR_GRAD1, string);

			SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
		}
}
	}
You don't want to know...
Reply
#2

The compiler never report errors without a reason.

You really don't see the obvious problem?
Reply
#3

Ok, my first post proved that i'm an idiot, i got it now, forgot the damn "}" thanks anyway
Reply
#4

Ok, now got a real thing, i need the "amount" value to be text, but it only makes it number..., can i get a help in this please?
Reply
#5

Umm.. as you (is it your script?) do
pawn Код:
new amount;
amount = strval(tmp);
and as strval return the value of a string, you can deduce that the string you want is 'tmp'.

This command is very illogic.. it asks a string as argument, but then you just use the command argument as a value in the format :/ I'm not sure to understand what you want to do with this.
Reply
#6

No, the code is working (took out the srtval thing) but i need to save the thing as text and, it dosen't...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)