Jump to content
  • 0

script gm_is_online with warning and debug


acaciomilk

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  42
  • Reputation:   2
  • Joined:  02/21/19
  • Last Seen:  

hello guys i need help

After installing this script the following error appeared on my emulator:

image.png.bc384cb8d958768dd3d9457a6c734e61.png

how do i solve this problem?
 

Seguranca_Aviso.txt

Edited by acaciomilk
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  154
  • Reputation:   51
  • Joined:  07/15/13
  • Last Seen:  

You need erase close; lines and replace for end;

i've made some fixes, tested and working fine.

-	script	gm_is_online	-1,{

OnPCLoginEvent:
       
	if (getgmlevel()>=99) goto L_admin;
	if (getgmlevel()>=90) goto L_co_admin;
	if (getgmlevel()>=10) goto L_head;
	if (getgmlevel()>=4) goto L_event;
	if (getgmlevel()>=3) goto L_support;
	if (getgmlevel()>=2) goto L_helper;
	if (getgmlevel()>=0) goto L_player;
	readparam(bStr);
	readparam(bAgi);
	readparam(bVit);
	readparam(bInt);
	readparam(bDex);
	readparam(bLuk);

	if ((class >= 4054 && class <= 4079) || (class >= 4023 && class <= 4045) || (class >= 4096 && class <= 4108)){ //3rd Job Class
		if (readparam(bStr) > 99 || readparam(bAgi) > 99 || readparam(bVit) > 99 || readparam(bInt) > 99 || readparam(Dex) > 99 || readparam(bLuk) > 99){
			mes "[^FF0000Anti Cheat System^000000]";
			mes "We have detected you having stats over the limit. You will be disconnected shortly. If this is an error please contact the Game Master immediately.";
			atcommand "@option 2 0 0";
			atcommand "@battleignore";
			setoption 0x2,1;
			sc_start sc_berserk, 1000000000, 1;
			sleep2 5000; //5 Seconds delay
			atcommand "@kick "+strcharinfo(0)+"";
			end;
		}
	} else { //Other than 3rd Job Class

		if (readparam(bStr) > 99 || readparam(bAgi) > 99 || readparam(bVit) > 99 || readparam(bInt) > 99 || readparam(Dex) > 99 || readparam(bLuk) > 99){
			mes "[^FF0000Anti Cheat System^000000]";
			mes "We have detected you having stats over the limit. You will be disconnected shortly. If this is an error please contact the Game Master immediately.";
			atcommand "@option 2 0 0";
			atcommand "@battleignore";
			setoption 0x2,1;
			sc_start sc_berserk, 1000000000, 1;
			sleep2 5000; //5 Seconds delay
			atcommand "@kick "+strcharinfo(0)+"";
			end;

			L_admin:
			atcommand "@speed 1";
			announce "[ Admin ] "+strcharinfo(0)+" ist online",bc_all,0x00ff66;
			specialeffect2 377;
			specialeffect2 381;
			end;

			L_co_admin:
			atcommand "@speed 1";
			announce "[ Co Admin ] "+strcharinfo(0)+" ist online",bc_all,0x00ff66;
			specialeffect2 377;
			specialeffect2 381;
			end;

			L_head:
			atcommand "@speed 1";
			announce "[ Head GM ] "+strcharinfo(0)+" ist online",bc_all,0x00ff66;
			specialeffect2 377;
			specialeffect2 381;
			end;

			L_event:
			atcommand "@speed 1";
			announce "[ Event GM ] "+strcharinfo(0)+" online",bc_all,0x00ff66;
			specialeffect2 377;
			specialeffect2 381;
			end;

			L_support:
			atcommand "@speed 1";
			announce "[ Support GM ] "+strcharinfo(0)+" online",bc_all,0x00ff66;
			specialeffect2 377;
			specialeffect2 381;
			end;

			L_helper:
			atcommand "@speed 1";
			announce "[ Helper ] "+strcharinfo(0)+" online",bc_all,0x00ff66;
			specialeffect2 377;
			specialeffect2 381;
			end;

			L_player:
			end;
		}
	}
}

 

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   25
  • Joined:  12/24/14
  • Last Seen:  

16 hours ago, EIysium said:
if (getgmlevel()>=0) goto L_player;

if you put this, that can't check the limit status
 

try this for the fix

-	script	gm_is_online	-1,{

OnPCLoginEvent:
	if (getgmlevel()>=99) goto L_admin;
	if (getgmlevel()>=90) goto L_co_admin;
	if( getgmlevel()>=10) goto L_head;
	if (getgmlevel()>=4) goto L_event;
	if (getgmlevel()>=3) goto L_support;
	if (getgmlevel()>=2) goto L_helper;
	readparam(bStr);
	readparam(bAgi);
	readparam(bVit);
	readparam(bInt);
	readparam(bDex);
	readparam(bLuk);
	if ((class >= 4054 && class <= 4079) || (class >= 4023 && class <= 4045) || (class >= 4096 && class <= 4108)) {	//3rd Job Class
		if (readparam(bStr) > 99 || readparam(bAgi) > 99 || readparam(bVit) > 99 || readparam(bInt) > 99 || readparam(Dex) > 99 || readparam(bLuk) > 99){
			mes "[^FF0000Anti Cheat System^000000]";
			mes "We have detected you having stats over the limit. You will be disconnected shortly. If this is an error please contact the Game Master immediately.";
			atcommand "@option 2 0 0";
			atcommand "@battleignore";
			setoption 0x2,1;
			sc_start sc_berserk, 1000000000, 1;
			sleep2 5000; //5 Seconds delay
			atcommand "@kick "+strcharinfo(0)+"";
			end;
		}
	} else {	//Other than 3rd Job Class
		if (readparam(bStr) > 99 || readparam(bAgi) > 99 || readparam(bVit) > 99 || readparam(bInt) > 99 || readparam(Dex) > 99 || readparam(bLuk) > 99) {
			mes "[^FF0000Anti Cheat System^000000]";
			mes "We have detected you having stats over the limit. You will be disconnected shortly. If this is an error please contact the Game Master immediately.";
			atcommand "@option 2 0 0";
			atcommand "@battleignore";
			setoption 0x2,1;
			sc_start sc_berserk, 1000000000, 1;
			sleep2 5000; //5 Seconds delay
			atcommand "@kick "+strcharinfo(0)+"";
			end;
		}
	}
	L_admin:
		atcommand "@speed 1";
		announce "[ Admin ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
		specialeffect2 377;
		specialeffect2 381;
		end;
	L_co_admin:
		atcommand "@speed 1";
		announce "[ Co Admin ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
		specialeffect2 377;
		specialeffect2 381;
		end;
	L_head:
		atcommand "@speed 1";
		announce "[ Head GM ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
		specialeffect2 377;
		specialeffect2 381;
		end;
	L_event:
		atcommand "@speed 1";
		announce "[ Event GM ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
		specialeffect2 377;
		specialeffect2 381;
		end;
	L_support:
		atcommand "@speed 1";
		announce "[ Support GM ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
		specialeffect2 377;
		specialeffect2 381;
		end;
	L_helper:
		atcommand "@speed 1";
		announce "[ Helper ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
		specialeffect2 377;
		specialeffect2 381;
		end;
end;
}

 

Edited by mR L
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  862
  • Reputation:   115
  • Joined:  05/23/12
  • Last Seen:  

@acaciomilkI've optimized u're script a bit.

NOTE: I can't test it yet but it's should work.

Suggestions: Use close2; to close the dialog and afterwards u can kick player or else cause he will keep attached to the script. Then end; the script.

I can recommend to use switch(getgmlevel()) instead of calling so much script labels.

U readparam before checking it and call it in the if statement again. This makes no sense if u don't store it in an array or variable.

On the event labels u used close; but there was no dialog therefore its causes errors. U need to end; the script.

Don't declair labels inside an if statement. U're own labels needs to declaired like the default labels "OnInit" or "OnPCLoginEvent".

 

The close2; is better if u give/delete items or set variables cause auto-close can be abused.

 

Seguranca_Aviso optimized.txt

 

Rynbef~

Edited by Rynbef
Add a notice
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  42
  • Reputation:   2
  • Joined:  02/21/19
  • Last Seen:  

Hi guys, thank you very much for your help, in addition to solving my problem, I still managed to learn more!!

Thanks so much for the help again
 
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

a simplified version.

-	script	gm_is_online	-1,{

OnPCLoginEvent:
	.@gm_level = getgmlevel();
	
	if (.@gm_level == 99)
		callsub(L_GM, "Admin");
	else if (.@gm_level >= 90)
		callsub(L_GM, "Co-Admin");
	else if (.@gm_level >= 10)
		callsub(L_GM, "Head GM");
	else if (.@gm_level >= 4)
		callsub(L_GM, "Event GM");
	else if (.@gm_level >= 3)
		callsub(L_GM, "Support GM");
	else if (.@gm_level >= 2)
		callsub(L_GM, "Helper GM");
	
	if (readparam(bStr) > 99 || readparam(bAgi) > 99 || readparam(bVit) > 99 || readparam(bInt) > 99 || readparam(Dex) > 99 || readparam(bLuk) > 99){
		mes "[^FF0000Anti Cheat System^000000]";
		mes "We have detected you having stats over the limit. You will be disconnected shortly. If this is an error please contact the Game Master immediately.";
		setpcblock PCBLOCK_ALL, true;
		close2;
		atcommand "@kick "+strcharinfo(0);
		end;
	}
	end;
	
	L_GM:
		atcommand "@speed 1";
		announce "[ "+getarg(0)+" ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
		specialeffect2 377;
		specialeffect2 381;
		end;
		
}

 

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