SA-MP Forums Archive
Funny error - 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: Funny error (/showthread.php?tid=66406)



Funny error - matrix_smq - 21.02.2009

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...


Re: Funny error - yom - 21.02.2009

The compiler never report errors without a reason.

You really don't see the obvious problem?


Re: Funny error - matrix_smq - 21.02.2009

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


Re: Funny error - matrix_smq - 21.02.2009

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?


Re: Funny error - yom - 21.02.2009

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.


Re: Funny error - matrix_smq - 22.02.2009

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