Jump to content

Tutorial - Rezolvare Dialog Hider


InceMan

Recommended Posts

Tutorial/Ghid: Anti Dialog Hider

Dupa cum stiti, nu am mai postat de ceva timp aici, si am decis sa imi reiau activitatea, cu ceva nu foarte greu, dar folositor.

Multi isi pun intrebarea, cum rezolv Dialog Hider-ul, ei bine, eu v-am facut un tutorial in cateva linii ce va ajuta in gamemode-ul vostru.

Citat

#define function%0(%1) forward%0(%1);public%0(%1)
new dialogID[MAX_PLAYERS], kickWarnings[MAX_PLAYERS];

stock GetName(playerid) {
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, MAX_PLAYER_NAME);
	return name;
}

public OnPlayerConnect(playerid) {
	dialogID[playerid] = -1;
	kickWarnings[playerid] = 0;
	return true;
}

public OnPlayerDisconnect(playerid, reason) {
	dialogID[playerid] = -1;
	kickWarnings[playerid] = 0;
	return true;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
	if(dialogID[playerid] == -1) {
		new string[128];
		kickWarnings[playerid] ++;
		if(kickWarnings[playerid] < 3) {
			format(string, sizeof string, "%s may be using Dialog Hider (%d warnings).", GetName(playerid), kickWarnings[playerid]);
			SendClientMessageToAll(-1, string);
		}
        else {
			format(string, sizeof string, "%s has been kicked for Dialog Hider (3 warnings).", GetName(playerid));
			SendClientMessageToAll(-1, string);
			Kick(playerid);
		}
		return true;
	}
	dialogID[playerid] = -1;
	switch(dialogid) {
    
    // restul

	}
	return true;
}

function ShowPlayerDialogEx(playerid, dialogid, dialogtype, title[], string[], btn1[], btn2[]) {
	dialogID[playerid] = dialogid;
	return ShowPlayerDialog(playerid, dialogid, dialogtype, title, string, btn1, btn2);
} 

 

Sper ca v-a fost de ajutor, nu ezitati un +1 daca v-a placut.

  • Upvote 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 5 months later...
4 hours ago, Geani said:

restul la ce ai tu in  OnDialogResponse

Adica trebuie sa adaug absout toate dialog-urile acolo? Si cum trebuiesc adaugate frate? Gen asa:

 

    //restul
	case DIALOG_SKIN:
	{
		if(PlayerInfo[playerid][pSkins][id] == -1) // blablabla 
	}

Cat despre functia asta 

function ShowPlayerDialogEx

Eu in GM folosesc doar ShowPlayerDialog, trebuie sa le trec toate pe Ex?

Edited by Alex Alexandru
Link to comment
Share on other sites

  • 3 weeks later...
La 28.02.2019 la 14:05, Alex Alexandru a spus:

Adica trebuie sa adaug absout toate dialog-urile acolo? Si cum trebuiesc adaugate frate? Gen asa:

 


    //restul
	case DIALOG_SKIN:
	{
		if(PlayerInfo[playerid][pSkins][id] == -1) // blablabla 
	}

Cat despre functia asta 


function ShowPlayerDialogEx

Eu in GM folosesc doar ShowPlayerDialog, trebuie sa le trec toate pe Ex?

poti sa scoti acel Ex

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

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

Guest
Reply to this topic...

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.