Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Criador : Danniel_Cooper.
- Comandos : /meucash , /darcash (Admin RCON), /comprarvip, /jetpack, /rvip, /nitrovip
- -------------------------------
- Não remova os créditos, você não ganha absolutamente nada fazendo isso!
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- #include <dof2>
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define Msg SendClientMessage
- #define ERRO 0xFF030FFF
- #define ROXO 0xB360FDFF
- new Cash[MAX_PLAYERS], VIP[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Cash System 1.0 by Danniel_Cooper iniciado.");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Cash System 1.0 by Danniel_Cooper fechado.");
- print("--------------------------------------\n");
- DOF2_Exit();
- return 1;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- CarregarCash(playerid);
- CarregarVip(playerid);
- Msg(playerid, -1, "Este servidor tem o sistema Cash System criado por Danniel_Cooper!");
- return 1;
- }
- stock pNome(playerid){
- static Nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- return Nome;
- }
- stock CarregarCash(playerid){
- new arquivo[30], string[18], valor;
- format(string, sizeof(string), "CashSystem/%s.cfg", arquivo);
- if(DOF2_FileExists(arquivo)){
- DOF2_GetInt(arquivo, "Cash");
- valor = Cash[playerid];
- Cash[playerid] = valor;
- }
- return 1;
- }
- stock CarregarVip(playerid){
- new arquivo[30], string[50];
- format(string, sizeof(string), "CashSystem/%sVIP.cfg", arquivo);
- if(DOF2_FileExists(arquivo)){
- DOF2_GetInt(arquivo, "VIP");
- VIP[playerid] = 1;
- }
- return 1;
- }
- CMD:darcash(playerid, params[]){
- new string[100], plid, nome2[MAX_PLAYER_NAME], arquivo[30];
- GetPlayerName(plid, nome2, sizeof(nome2));
- if(!IsPlayerAdmin(playerid)) return Msg(playerid, ERRO, "Você não tem autorização para usar este comando!");
- if(sscanf(params, "ud", plid, params[0])) return Msg(playerid, ERRO, " Use /darlevel [ID] [Quantidade]");
- if(params[0] < 1 && params[1] > 10000000) return Msg(playerid, ERRO, "Cash mínimo 1, máximo 10000000.");
- if(!IsPlayerConnected(plid)) return Msg(playerid, ERRO, "Jogador não conectado!");
- Cash[plid] += params[0];
- format(string, sizeof(string), "CashSystem/%s.cfg", arquivo);
- DOF2_CreateFile(arquivo);
- DOF2_SetInt(arquivo, "Cash", Cash[playerid]);
- DOF2_SaveFile();
- format(string, sizeof(string), "Você deu %d de cash para %s!", params[0], nome2);
- Msg(playerid, ROXO, string);
- format(string, sizeof(string), "Administrador %s te deu %d de cash!", pNome(playerid), params[0]);
- Msg(plid, ROXO, string);
- printf("[CONSOLE] - %s deu %d de cash para %s", pNome(playerid), params[0], nome2);
- return 1;
- }
- CMD:meucash(playerid){
- new string[100], arquivo[30];
- format(string, sizeof(string), "CashSystem/%s.cfg", arquivo);
- if(!DOF2_FileExists(arquivo)){
- return Msg(playerid, -1, "Você não tem Cash!");
- }
- else{
- format(string, sizeof(string), "Você tem %d de cash!", Cash[playerid]);
- Msg(playerid, ROXO, string);
- }
- return 1;
- }
- CMD:comprarvip(playerid){
- if(Cash[playerid] < 10000){ // Valor que você editará se quiser abaixar ou almentar o preço . . .
- return Msg(playerid, -1, "Você precisa ter 10000 de Cash para comprar VIP!");
- }
- else
- {
- new string[50], arquivo[30];
- format(string, sizeof(string), "CashSystem/%sVIP.cfg");
- DOF2_CreateFile(arquivo);
- DOF2_SetInt(arquivo, "VIP", VIP[playerid]);
- DOF2_SaveFile();
- VIP[playerid] = 1;
- Msg(playerid, -1, "Parabéns, você adquiriu seu VIP, foi descontado 10000 de Cash, e você ganhou 1kk!");
- GivePlayerMoney(playerid, 1000000);
- Cash[playerid] -= 10000;
- }
- return 1;
- }
- CMD:jetpack(playerid){
- if(!VIP[playerid]) return Msg(playerid, ERRO, "Você não é VIP!");
- SetPlayerSpecialAction(playerid, 2);
- return 1;
- }
- CMD:rvip(playerid){
- new vehicle;
- vehicle = GetPlayerVehicleID(playerid);
- if(!VIP[playerid]) return Msg(playerid, ERRO, "Você não é VIP!");
- if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid, ERRO, "Você não está em um veiculo!");
- SetVehicleHealth(vehicle, 1000);
- Msg(playerid, ROXO, "Vehiculo reparado!");
- return 1;
- }
- CMD:nitrovip(playerid){
- new vehicle;
- vehicle = GetPlayerVehicleID(playerid);
- if(!VIP[playerid]) return Msg(playerid, ERRO, "Você não é VIP!");
- if(vehicle > 0){
- AddVehicleComponent(vehicle, 1010);
- Msg(playerid, ROXO, "Nitro setado!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement