Jump to content
  • 0

Problema Anti Hack


Question

Posted

Salut am facut si eu acest anti hack de aici http://forum.sa-mp.com/showthread.php?t=71136

da problema este cand dau /givemoney la cineva ii ia banii care ii i-am dat.

cum pot sa fac sa nu le mai ia banii?

7 answers to this question

Recommended Posts

Posted

Cand Folosesti asta nu mai trebuie sa folosesti "GivePlayerMoney" pentru ca va detecta ca hack.

Foloseste SetPlayerCash in comanda care le da bani.

Posted

Problema e ca daca am 100k la mine in mana si dau /givemoney numele meu si 50k ma seteaza cu 50k nu cu 150k..

if(strcmp(cmd, "/givemoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "UTILIZARE: /givemoney [playerid/PartOfName] [money]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
			            ConsumingMoney[playa] = 1;
						SetPlayerCash(playa, money);
						GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						format(string, 128, "AdmWarning: %s has admin given %d to %s.", sendername,money,giveplayer);
						ABroadCast(COLOR_YELLOW,string,1);
						AdminLog(string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "Nu ai level-ul de admin suficient pentru a folosi aceasta comanda.");
			}
		}
		return 1;
	}

Posted

E o diferenta in scriptul asta:

GivePlayerCash - Adauga suma setata de tine la banii care deja ii ai.

SetPlayerCash - Reseteaza banii care ii aveai inainte si adauga suma introdusa de tine in schimb.

Posted

Pai si cum fac sa mearga sa adauge si peste?

Inlocuieste SetPlayerCash cu GivePlayerCash

Guest
This topic is now closed to further replies.
×
×
  • 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.