Jump to content
  • 0

Npc Error & Debug check-[ Anti Edit System ]


christofereduardo

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   2
  • Joined:  06/06/13
  • Last Seen:  

 

Hi, I'm having this script and I'm facing some errors and Debug would like to log in to delete all of the [setarray] items but he's only deleting one every time I log into the account, please someone can help me.

Errors debugs:

[Error]: buildin_countitem: fatal error ! player not attached!
[Debug]: Function: countitem (1 parameter):
[Debug]: Data: variable name='$proibidos' index=0
[Debug]: Source (NPC): AntiEdit (invisible/not on a map)

 

Npc Script:

-	script	AntiEdit	-1,{

OnInit:
	setarray $proibidos[0],1599,2199; // Colque os ID's dos itens proibidos

OnPCLoginEvent:
		for(set .@i,0; .@i < getarraysize($proibidos); set .@i,.@i + 1){
			query_sql "DELETE FROM `storage` WHERE `nameid` = '"+$proibidos[.@i]+"'";
			query_sql "DELETE FROM `cart_inventory` WHERE `nameid` = '"+$proibidos[.@i]+"'";
			query_sql "DELETE FROM `guild_storage` WHERE `nameid` = '"+$proibidos[.@i]+"'";
			query_sql "DELETE FROM `auction` WHERE `nameid` = '"+$proibidos[.@i]+"'";
			query_sql "DELETE FROM `mail` WHERE `send_id` = '"+$proibidos[.@i]+"'";
		if(countitem($proibidos[.@i]) >= 1){
			delitem $proibidos[.@i],1;
			dispbottom "[Segurança] "+getitemname($proibidos[.@i])+" foi deletado do seu inventário por ser um item proibido.";
			end;
		}
	}
}
-	script	AntiEditstatus	-1,{

OnPCLoginEvent:
	for( set .@i,13; .@i <=18; set .@i,.@i + 1 )
	if( readparam(.@i) > 120 )
	 set .@OverStat,.@OverStat + 1;
	if( .@OverStat ){
	announce "O player "+strcharinfo(0)+" foi banido por motivos de tentar burlar pontos de atributos.",8;
	sleep2 9000;
	atcommand "@kick "+strcharinfo(0);
	atcommand "@block " + strcharinfo(0);
	}
end;
}

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Add end; after setarray then it should work.

You don't get the error when login in, you get it when the server starts cuz of an missing end; at OnInit. The server continues afterwards what it shouldn't.

Regards, 

Chris

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   2
  • Joined:  06/06/13
  • Last Seen:  

13 hours ago, llchrisll said:

Add end; after setarray then it should work.

You don't get the error when login in, you get it when the server starts cuz of an missing end; at OnInit. The server continues afterwards what it shouldn't.

Regards, 

Chris

Tanks Fix the problem!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

6 hours ago, sader1992 said:

$proibidos

TO


.proibidos

 

That wasn't the problem. :)

  • Upvote 1
Link to comment
Share on other sites

  • -3

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1678
  • Reputation:   704
  • Joined:  12/21/14
  • Last Seen:  

$proibidos

TO

.proibidos

 

Edited by sader1992
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...