caltabos Posted March 5, 2019 Report Share Posted March 5, 2019 ba am adaugat o coamnda beneficii si cad dau pe server ma lasa sa dau de cate ori vreau! dar am pus verificarea poate nu am facut bine in baza! Comanda: } CMD:beneficii(playerid, params[]) { if(PlayerInfo[playerid][pYT] == 0) return SCM(playerid, -1, "Nu esti {000000}You{ff0000}Tuber{FFFFFF}!"); if(PlayerInfo[playerid][pBeneficii] == 1) return SCM(playerid, -1, "Ai luat deja aceste beneficii!"); GivePlayerMoney(playerid, 20000000); Update(playerid, pCashx); PlayerInfo[playerid][pPremiumPoints] += 30; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pLevel]++; Update(playerid, pLevelx); SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]); Update(playerid, pBeneficiix); SendClientMessage(playerid, COLOR_WHITE, "{b70000}Bonus: {FFFFFF}Ai primit {00a521}20,000,000$ {ffb407}30 Puncte Premium {FFFFFF}si {b70000}level up {FFFFFF}ca bonus."); return 1; } Si in systmes am adaugat: #define pBeneficiix si case pBeneficiix: format(var, sizeof(var), "UPDATE `users` SET `Beneficii`='%d' WHERE `ID`='%d'",PlayerInfo[playerid][pBeneficii], PlayerInfo[playerid][pSQLID]); Quote Link to comment Share on other sites More sharing options...
1 ionutdrg45 Posted March 5, 2019 Report Share Posted March 5, 2019 33 minutes ago, caltabos said: ba am adaugat o coamnda beneficii si cad dau pe server ma lasa sa dau de cate ori vreau! dar am pus verificarea poate nu am facut bine in baza! pai tu vrei sa faci update, dar trebuie sa ii spui si ce sa updateze, asa va ramane valoare initiala care va fi incarcata din nou, trebuie sa pui PlayerInfo[playerid][pBeneficii] =1 ; si cred ca ar fi bine sa vezi daca le si incarci din baza de date in momentul conectarii, sa nu te trezesti ca ai adaugat mai multe chestii si nu se salveaza 1 Quote Link to comment Share on other sites More sharing options...
0 caltabos Posted March 5, 2019 Author Report Share Posted March 5, 2019 Acum 3 ore, Ionut_WS a spus: pai tu vrei sa faci update, dar trebuie sa ii spui si ce sa updateze, asa va ramane valoare initiala care va fi incarcata din nou, trebuie sa pui PlayerInfo[playerid][pBeneficii] =1 ; si cred ca ar fi bine sa vezi daca le si incarci din baza de date in momentul conectarii, sa nu te trezesti ca ai adaugat mai multe chestii si nu se salveaza am pus la on playerlogin mysql_fetch_field_row(result,"Beneficii"); PlayerInfo[playerid][pBeneficii] = strval( result ); Quote Link to comment Share on other sites More sharing options...
0 ASGOOD Posted March 5, 2019 Report Share Posted March 5, 2019 (edited) 42 minutes ago, caltabos said: am pus la on playerlogin mysql_fetch_field_row(result,"Beneficii"); PlayerInfo[playerid][pBeneficii] = strval( result ); Nu conteaza, pune si in comanda PlayerInfo[playerid][pBeneficii] = 1; de preferat deasupra acestei linii: Update(playerid, pBeneficiix); Edited March 5, 2019 by ASGOOD Quote Link to comment Share on other sites More sharing options...
Question
caltabos
ba am adaugat o coamnda beneficii si cad dau pe server ma lasa sa dau de cate ori vreau! dar am pus verificarea poate nu am facut bine in baza!
Comanda: } CMD:beneficii(playerid, params[]) { if(PlayerInfo[playerid][pYT] == 0) return SCM(playerid, -1, "Nu esti {000000}You{ff0000}Tuber{FFFFFF}!"); if(PlayerInfo[playerid][pBeneficii] == 1) return SCM(playerid, -1, "Ai luat deja aceste beneficii!"); GivePlayerMoney(playerid, 20000000); Update(playerid, pCashx); PlayerInfo[playerid][pPremiumPoints] += 30; Update(playerid, pPremiumPointsx); PlayerInfo[playerid][pLevel]++; Update(playerid, pLevelx); SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]); Update(playerid, pBeneficiix); SendClientMessage(playerid, COLOR_WHITE, "{b70000}Bonus: {FFFFFF}Ai primit {00a521}20,000,000$ {ffb407}30 Puncte Premium {FFFFFF}si {b70000}level up {FFFFFF}ca bonus."); return 1; } Si in systmes am adaugat: #define pBeneficiix si case pBeneficiix: format(var, sizeof(var), "UPDATE `users` SET `Beneficii`='%d' WHERE `ID`='%d'",PlayerInfo[playerid][pBeneficii], PlayerInfo[playerid][pSQLID]);
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.