Cedry2k Posted June 26, 2018 Share Posted June 26, 2018 Am o intrebare cum pot face sa nu poti da mai mult de 1kkk sa fie maxima suma din joc 1kkk. Sau atunci cand un admin da de mai multe ori /givemoney sa poate da maxim 1kkk. Link to comment Share on other sites More sharing options...
NoManPv Posted June 26, 2018 Share Posted June 26, 2018 cmd:givemoney(playerid, params[]) { if(strlen(PlayerInfo[playerid][pPin]) != 0 && PlayerInfo[playerid][pPinLogged] == 0) { SendClientMessage(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda deoarece nu te-ai autentificat cu codul de securitate."); SendClientMessage(playerid, COLOR_GREY, "Pentru a te autentifica, foloseste comanda '/loginpin'!"); return 1; } if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_LGREEN, "You are not an admin."); new money,id,string[180],sendername[25],giveplayer[25]; if(sscanf(params, "ui",id,money)) return SendClientMessage(playerid,COLOR_GREY, "USAGE: {FFFFFF}/givemoney <playerid/name> <Suma>"); if(money < -500000000 || money > 1000000000) return SCM(playerid, -1, "Suma invalida!"); if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat."); GivePlayerCash(id, money); GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "{C40808}(Admin Info){FFFFFF} %s i-a trimis %s lui %s.", sendername,FormatNumber(money),giveplayer); if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string,5); format(string, sizeof(string), "I-ai trimis lui {7BAABA}%s(%d){FFFFFF} $%s.", GetName(id), id, FormatNumber(money)); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "Admin {7BAABA}%s{FFFFFF} ti-a trimis $%s.", GetName(playerid), FormatNumber(money)); SendClientMessage(id, COLOR_WHITE, string); Update(id, pCashx); format(string, sizeof(string), "%s a primit $%s de la %s (/givemoney)", GetName(id), FormatNumber(money), GetName(playerid)); InsertLog(id, string, LOG_MONEY); return 1; } Link to comment Share on other sites More sharing options...
iCristiaN Posted June 27, 2018 Share Posted June 27, 2018 cmd:givemoney(playerid, params[]) { if(strlen(PlayerInfo[playerid][pPin]) != 0 && PlayerInfo[playerid][pPinLogged] == 0) { SendClientMessage(playerid, COLOR_GREY, "Nu poti folosi aceasta comanda deoarece nu te-ai autentificat cu codul de securitate."); SendClientMessage(playerid, COLOR_GREY, "Pentru a te autentifica, foloseste comanda '/loginpin'!"); return 1; } if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_LGREEN, "You are not an admin."); new money,id,string[180],sendername[25],giveplayer[25]; if(sscanf(params, "ui",id,money)) return SendClientMessage(playerid,COLOR_GREY, "USAGE: {FFFFFF}/givemoney <playerid/name> <Suma>"); if(money < -500000000 || money > 1000000000) return SCM(playerid, -1, "Suma invalida!"); if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat."); GivePlayerCash(id, money); GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "{C40808}(Admin Info){FFFFFF} %s i-a trimis %s lui %s.", sendername,FormatNumber(money),giveplayer); if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string,5); format(string, sizeof(string), "I-ai trimis lui {7BAABA}%s(%d){FFFFFF} $%s.", GetName(id), id, FormatNumber(money)); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "Admin {7BAABA}%s{FFFFFF} ti-a trimis $%s.", GetName(playerid), FormatNumber(money)); SendClientMessage(id, COLOR_WHITE, string); Update(id, pCashx); format(string, sizeof(string), "%s a primit $%s de la %s (/givemoney)", GetName(id), FormatNumber(money), GetName(playerid)); InsertLog(id, string, LOG_MONEY); return 1; } Cred ca face referire la toate sumele adica, suma maxim din mana cat si cea maxima din banca. Link to comment Share on other sites More sharing options...
Cedry2k Posted June 27, 2018 Author Share Posted June 27, 2018 Nu man sa nu se poata da mai mult de 1kk ca asa dai de mai multe ori cate 1kkk si da pe minus Link to comment Share on other sites More sharing options...
Administrator Leonard Posted June 27, 2018 Administrator Share Posted June 27, 2018 Arata-mi comanda /givemoney www.liberty.mp Link to comment Share on other sites More sharing options...
Cedry2k Posted June 27, 2018 Author Share Posted June 27, 2018 https://pastebin.com/ngxbj27D Link to comment Share on other sites More sharing options...
Kravyus Posted June 27, 2018 Share Posted June 27, 2018 https://pastebin.com/d7Q34mTb Link to comment Share on other sites More sharing options...
Cedry2k Posted June 27, 2018 Author Share Posted June 27, 2018 nu merge comanda care mi-ai dat-o Link to comment Share on other sites More sharing options...
Filip Posted June 27, 2018 Share Posted June 27, 2018 o variabila de tip int poate contine -2147483648 ... 2147483647 de numere, ai nevoie de 2 variabile si sa stochezi banii in ambele Link to comment Share on other sites More sharing options...
Administrator Leonard Posted June 28, 2018 Administrator Share Posted June 28, 2018 @@Cedry2k Faci o verificare la comanda [/givemoney] in felul urmator if(money < 0 || money > 1000000000) return SendClientMessage(playerid, COLOR_GREY, "Suma invalida. ( 1$ - 1,000,000,000$ )"); Iar comanda ta trebuie sa arate asa: CMD:givemoney(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_WHITE, AdminOnly); new money,id,string[180],sendername[25],giveplayer[25]; if(sscanf(params, "ui",id,money)) return SendClientMessage(playerid,COLOR_GREY, "USAGE: {FFFFFF}/givemoney <playerid/name> <Suma>"); if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat."); if(money < 0 || money > 1000000000) return SendClientMessage(playerid, COLOR_GREY, "Suma invalida. ( 1$ - 1,000,000,000$ )"); // verificarea de mai sus GivePlayerCash(id, money); GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "AdmCmd: %s i-a trimis %s lui %s.", sendername,FormatNumber(money),giveplayer); if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string,5); format(string, sizeof(string), "I-ai trimis lui {7BAABA}%s(%d){FFFFFF} $%s.", GetName(id), id, FormatNumber(money)); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "Admin {7BAABA}%s{FFFFFF} ti-a trimis $%s.", GetName(playerid), FormatNumber(money)); SendClientMessage(id, COLOR_WHITE, string); Update(id, pCashx); format(string, sizeof(string), "%s a primit $%s de la %s (/givemoney)", GetName(id), FormatNumber(money), GetName(playerid)); InsertLog(id, string, LOG_MONEY); return 1; } www.liberty.mp Link to comment Share on other sites More sharing options...
Recommended Posts