Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Recommended Posts

Posted

Salut salbaticilor , as avea nevoie de un tutorial cum sa creem puncte ,stil PremiumPoints ! 

Multumesc ;

CMD:credits(playerid, params[]) {
	SendClientMessage(playerid,-1,"Munca depusa merita rasplatita #respect");
	return 1;
}

 

Posted

Daca vrei sa ai sistem de premium points va trebui sa ai si un shop pentru a le folosi.

 Pentru a salva PP-urile playerului adaugi inca un camp la enum si-l denumesti pPremiumPoints, creezi o coloana noua in rubrica users din baza de date (asta doar daca folosesti) si la fiecare logare iei valoarea din baza de date a respectivului jucator si i-o atribui in variabila PlayerInfo[playerid][pPremiumPoints], respectiv la fiecare deconectare introduci in baza de date numarul de PP uri ale jucatorului x.

 Apoi faci ceva shop in care sa folosesti punctele:

CMD:ppshop(playerid, params[]) {
	
	// verificarile tale daca-i ON .. stiu eu ce mai folosesti

	ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_LIST, "SHOP", "1.000.000 $\t100 PP\n100.000$\t 50 PP", "Cumpara", "Iesi");  
	return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
	if(dialogid == DIALOG_SHOP) {
		if(!response) return 1;
		
		if(listitem == 0) {
			if(PlayerInfo[playerid][pPremiumPoints] < 100) return SCM(playerid, -1, "Nu ai destule PP)";
            PlayerInfo[playerid][pPremiumPoints] -= 100; // tot una cu x = x - 100 (x-=100)
            GivePlayerMoney(playerid, 1000000);
            
            new Query[256];
			mysql_format(Query, sizeof(Query), "UPDATE `users` SET `Premiumpoints`='%d' WHERE `Name`='%s'", PlayerInfo[playerid][pPremiumPoints], GetName(playerid));
            mysql_tquery(SQL, Query, "", "");  // asta e toata partea de salvare
		}
	}

	return 1;
}

 

76561198110915771.pngAddFriend.png

Posted

Frumos , stiu ca e asa simplu , dar nu reuseam sa fac ,multumesc.

CMD:credits(playerid, params[]) {
	SendClientMessage(playerid,-1,"Munca depusa merita rasplatita #respect");
	return 1;
}

 

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.