Jump to content

Recommended Posts

Posted

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

  • 5 months later...
Posted
Acum 1 oră, Alex Alexandru a spus:

// restul adica ce? :D

restul la ce ai tu in  OnDialogResponse

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Posted (edited)
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
  • 3 weeks later...
Posted
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

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.