Jump to content

[REZOLVAT] Problema gamemode burned


Cedry2k
 Share

Recommended Posts

  • Administrator

@@Cedry2k

 

Daca ai sta putin sa examinezi sistemul de raport automat din gamemode-ul burned, ai gasii problema in mai putin de 30s.

 

M-am uitat prin cod si am gasit rezolvarea in 15 secunde maxim.

 

Du-te la comanda 

:accept(playerid, params[])

cauta

else if(strcmp(x_job,"ticket",true) == 0)

si la finalul acestui "else if" ai functia

UpdateFactionRaport(id, 1);	

Daca stam sa examinam functia UpdateFactionRaport care arata ca asa:

function UpdateFactionRaport(playerid, type) {
	new query[256], string[128];
	if(type <= 4) {
		PlayerInfo[playerid][pCommands][type] ++;
		if(type == 0) format(query, sizeof(query), "UPDATE `users` SET `Commands`='%d' WHERE `ID`='%d'", PlayerInfo[playerid][pCommands][type], PlayerInfo[playerid][pSQLID]);
		else format(query, sizeof(query), "UPDATE `users` SET `Commands%d`='%d' WHERE `ID`='%d'", type+1, PlayerInfo[playerid][pCommands][type], PlayerInfo[playerid][pSQLID]);
		mysql_tquery(SQL, query, "", "");
	}
	else if(type == 5) {
		PlayerInfo[playerid][pFires] ++;
		UpdateVar(playerid, "Fires", PlayerInfo[playerid][pFires]);	
	}
	
	if(tograport[playerid] == 0) {	
		switch(type) {
			case 0: {
				if(IsACop(playerid)) format(string, sizeof(string), "Runners: %d", PlayerInfo[playerid][pCommands][type]);
				else if(IsAMember(playerid)) format(string, sizeof(string), "Activitate war: %d", PlayerInfo[playerid][pCommands][type]);
				else if(PlayerInfo[playerid][pMember] == 12) format(string, sizeof(string), "Playeri dusi la destinatie: %d", PlayerInfo[playerid][pCommands][type]);
				else if(PlayerInfo[playerid][pMember] == 9) format(string, sizeof(string), "Anunturi/Live-uri: %d", PlayerInfo[playerid][pCommands][type]);
				else if(PlayerInfo[playerid][pMember] == 8) format(string, sizeof(string), "Vehicule tractate/Servicii acordate: %d", PlayerInfo[playerid][pCommands][type]);
				else if(PlayerInfo[playerid][pMember] == 7) format(string, sizeof(string), "Licente acordate: %d", PlayerInfo[playerid][pCommands][type]);
				else if(PlayerInfo[playerid][pMember] == 13) format(string, sizeof(string), "Playeri salvati: %d", PlayerInfo[playerid][pCommands][type]);
				else if(PlayerInfo[playerid][pMember] == 11) format(string, sizeof(string), "Contracte: %d", PlayerInfo[playerid][pCommands][type]);
				else format(string, sizeof(string), "Progres raport: %d", PlayerInfo[playerid][pCommands][type]);
			}
			case 1: {
				if(IsACop(playerid)) format(string, sizeof(string), "Arrests: %d", PlayerInfo[playerid][pCommands][type]);
			}
			case 2: {
				if(IsACop(playerid)) format(string, sizeof(string), "Tickets: %d", PlayerInfo[playerid][pCommands][type]);
			}
			case 3: {
				if(IsACop(playerid)) format(string, sizeof(string), "Licences confiscated: %d", PlayerInfo[playerid][pCommands][type]);
			}
			case 4: {
				if(IsACop(playerid)) format(string, sizeof(string), "Drugs confiscated: %d", PlayerInfo[playerid][pCommands][type]);
			}	
			case 5: {
				if(PlayerInfo[playerid][pMember] == 13) format(string, sizeof(string), "Incendii: %d", PlayerInfo[playerid][pFires]);
			}
		}
		SCM(playerid, COLOR_YELLOW, string);
	}
	return 1;
}

In comanda [/accept], functia UpdateFactionRaport adauga un punct de raport la cazul 1, cel pe care il are stat, dar in cazul de fata, cazul 1 este "Arrests".

 

In concluzie, ca sa rezolvi aceasta problema modifica valoarea functiei de la comanda [/accept] din 1 in 2.

UpdateFactionRaport(id, 1); -> UpdateFactionRaport(id, 2);		

Daca viitoare, examineaza bine problema si incearca sa rezolvi singur, asa inveti.

Daca ceri ajutor la orice chestie banala, nu vei invata in veci.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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