Jump to content
  • 0

Npc Error & Debug check-[ Anti Edit System ]


Question

Posted

 

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;
}

 

4 answers to this question

Recommended Posts

  • 1
Posted

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
  • 0
Posted
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!

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...