Some Errors I Didnt understand
#1

Alright,


Im new at scripting for SAMP. Its alot harder then most games. I have started out with a deathmatch script and its going really well. Got pretty much everything that i wanted to get up up. But i was looking around with FilterScripts and found a admin system one. Its a great admin system. I love it. But a friend that has been helping me learn and everything says its better to hardcode the stuff in ur script. So i started on that tonight. Got everthing fixed execpt for 4 errors. Which are as following:
(125) : warning 219: local variable "plName" shadows a variable at a preceding level
(135) : warning 219: local variable "plName" shadows a variable at a preceding level
(177) : error 029: invalid expression, assumed zero
(177) : warning 215: expression has no effect
(177) : error 001: expected token: ";", but found "]"
(177) : error 029: invalid expression, assumed zero
(177) : fatal error 107: too many error messages on one line
4 Errors.






Now i no what error 107 is. Its easy. But the others i dont no. Here are the lines of script that have the errors on them:
(135) new plName[MAX_PLAYER_NAME], string[56];
(177) if([playerid][Muted] == 1)


Please Help Me out with this,


Rick
Reply
#2

show us your code,and post the full errors
Reply
#3

(125) : warning 219: local variable "plName" shadows a variable at a preceding level
(135) : warning 219: local variable "plName" shadows a variable at a preceding level
(177) : error 029: invalid expression, assumed zero
(177) : warning 215: expression has no effect
(177) : error 001: expected token: ";", but found "]"
(177) : error 029: invalid expression, assumed zero
(177) : fatal error 107: too many error messages on one line

The first two errors mean that you've defined "new plname" more than once, but they're warnings.

For your errors, please paste line 177, it's likely you've missed a required part of your code which is triggering this compilation error.

To go to a line in your editor, hit CTRL + G and then type '177'.
Reply
#4

This is line 177: if([playerid][Muted] == 1)

This is the callback it is in. I didnt code it, i am just hard codeing it in. And editing a few commands here and there:

Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{


 	if([playerid][Muted] == 1)
	{
		new string[128];
 		[playerid][MuteWarnings]++;
		if([playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
			format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)", [playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
			SendClientMessage(playerid,red,string);
		} else {
			SendClientMessage(playerid,red,"You have been warned! Now you have been kicked");
			GetPlayerName(playerid, string, sizeof(string));
			format(string, sizeof(string),"%s [ID %d] Kicked for exceeding mute warnings", string, playerid);
			SendClientMessageToAll(grey,string);
			SaveToFile("KickLog",string); Kick(playerid);
		} return 0;
	}
	return 1;
}


Thanks For The Help,


Rick
Reply
#5

You'll want to do this:

Muted[playerid]

NOT

[playerid][Muted]
Reply
#6

Alright thanks,

Acouple more errors though....

Here they are:

Код:
C:\Documents and Settings\Marcus A. Robinson\Desktop\KMDM1.pwn(125) : warning 219: local variable "plName" shadows a variable at a preceding level
C:\Documents and Settings\Marcus A. Robinson\Desktop\KMDM1.pwn(135) : warning 219: local variable "plName" shadows a variable at a preceding level
C:\Documents and Settings\Marcus A. Robinson\Desktop\KMDM1.pwn(177) : error 017: undefined symbol "Muted"
C:\Documents and Settings\Marcus A. Robinson\Desktop\KMDM1.pwn(177) : warning 215: expression has no effect
C:\Documents and Settings\Marcus A. Robinson\Desktop\KMDM1.pwn(177) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Marcus A. Robinson\Desktop\KMDM1.pwn(177) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Marcus A. Robinson\Desktop\KMDM1.pwn(177) : fatal error 107: too many error messages on one line
Its all the errors i no, to lazy to delete the lines, tired as hell...

Rick
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)