Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Diálogos
- #define ESTILOPELEA1 (500)
- #define ESTILOPELEA2 (501)
- // Enum
- enum jInfo
- {
- Pelea1,
- Pelea2,
- Pelea3,
- Pelea4,
- Pelea5
- }
- new Jugador[MAX_PLAYERS][jInfo];
- forward SacarDinero(playerid,cantidad);
- public SacarDinero(playerid,cantidad)
- {
- if(cantidad < 0) return 1;
- Jugador[playerid][Dinero] -= cantidad; // Jugador[playerid][Dinero] (Variable de dinero)
- GivePlayerMoney(playerid,-cantidad);
- return 1;
- }
- // Diálogos
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case ESTILOPELEA1:
- {
- if(response)
- {
- if(Jugador[playerid][Dinero] < 500) return SCM(playerid, -1, "Usted no posee $500 dólares."); // Jugador[playerid][Dinero] (Variable de dinero)
- switch(listitem)
- {
- case 0:
- {
- if(Jugador[playerid][Pelea1] == 1) return SCM(playerid, -1, "Ya sabes esta forma de pelea.");
- Jugador[playerid][Pelea1] = 1;
- SCM(playerid, -1, "Aprendiste la forma de pelea boxeo. usa /pelear.");
- SacarDinero(playerid, 500);
- }
- case 1:
- {
- if(Jugador[playerid][Pelea2] == 1) return SCM(playerid, -1, "Ya sabes esta forma de pelea.");
- Jugador[playerid][Pelea2] = 1;
- SCM(playerid, -1, "Aprendiste la forma de pelea kungfu. usa /pelear.");
- SacarDinero(playerid, 500);
- }
- case 2:
- {
- if(Jugador[playerid][Pelea3] == 1) return SCM(playerid, -1, "Ya sabes esta forma de pelea.");
- Jugador[playerid][Pelea3] = 1;
- SCM(playerid, -1, "Aprendiste la forma de pelea kneehead. usa /pelear.");
- SacarDinero(playerid, 500);
- }
- case 3:
- {
- if(Jugador[playerid][Pelea4] == 1) return SCM(playerid, -1, "Ya sabes esta forma de pelea.");
- Jugador[playerid][Pelea4] = 1;
- SCM(playerid, -1, "Aprendiste la forma de pelea grabkick. usa /pelear.");
- SacarDinero(playerid, 500);
- }
- case 4:
- {
- if(Jugador[playerid][Pelea5] == 1) return SCM(playerid, -1, "Ya sabes esta forma de pelea.");
- Jugador[playerid][Pelea5] = 1;
- SCM(playerid, -1, "Aprendiste la forma de pelea elbow. usa /pelear.");
- SacarDinero(playerid, 500);
- }
- }
- }
- return 1;
- }
- case ESTILOPELEA2:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
- SCM(playerid, -1, "Ahora peleas normalmente.");
- }
- case 1:
- {
- if(!(Jugador[playerid][Pelea1] == 1)) return SCM(playerid, -1, "Usted no sabe pelear como boxeador.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
- SCM(playerid, -1, "Ahora peleas como boxeador.");
- }
- case 2:
- {
- if(!(Jugador[playerid][Pelea2] == 1)) return SCM(playerid, -1, "Usted no sabe pelear como kungfu.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
- SCM(playerid, -1, "Ahora peleas como kungfu.");
- }
- case 3:
- {
- if(!(Jugador[playerid][Pelea3] == 1)) return SCM(playerid, -1, "Usted no sabe pelear como kneehead.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
- SCM(playerid, -1, "Ahora peleas como kneehead.");
- }
- case 4:
- {
- if(!(Jugador[playerid][Pelea4] == 1)) return SCM(playerid, -1, "Usted no sabe pelear como grabkick.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
- SCM(playerid, -1, "Ahora peleas como grabkick.");
- }
- case 5:
- {
- if(!(Jugador[playerid][Pelea5] == 1)) return SCM(playerid, -1, "Usted no sabe pelear como elbow.");
- SetPlayerFightingStyle(playerid, FIGHT_STYLE_ELBOW);
- SCM(playerid, -1, "Ahora peleas como elbow.");
- }
- }
- }
- return 1;
- }
- }
- return 1;
- }
- // Comando para aprender
- CMD:aprender(playerid, params[])
- {
- if(!(IsPlayerInRangeOfPoint(playerid, 1.5, 762.3311,9.5728,1001.1639))) return SCM(playerid, -1, "No estas en el gym de ganton.");
- {
- ShowPlayerDialog(playerid, ESTILOPELEA1, DIALOG_STYLE_LIST, "Aprender a pelear",
- "{FFFFFF} Boxeo \n\
- {FFFFFF} Kungfu \n\
- {FFFFFF} Kneehead \n\
- {FFFFFF} Grabkick \n\
- {FFFFFF} Elbow \n",
- "Aceptar", "Cancelar");
- }
- return 1;
- }
- // Comando para cambiar el estilo de pelea
- CMD:pelear(playerid, params[])
- {
- new string[128], custom_string[512];
- if(IsPlayerConnected(playerid))
- {
- format(string,sizeof(string),"Normal\n");
- strcat(custom_string, string);
- if(Jugador[playerid][Pelea1] == 1) { strcat(custom_string, "Boxeo ({1FFF00}disponible{FFFFFF})\n"); }
- else if(Jugador[playerid][Pelea1] == 0) { strcat(custom_string, "Boxeo ({FF0000}no disponible{FFFFFF})\n"); }
- if(Jugador[playerid][Pelea2] == 1) { strcat(custom_string, "Kungfu ({1FFF00}disponible{FFFFFF})\n"); }
- else if(Jugador[playerid][Pelea2] == 0) { strcat(custom_string, "Kungfu ({FF0000}no disponible{FFFFFF})\n"); }
- if(Jugador[playerid][Pelea3] == 1){ strcat(custom_string, "Kneehead ({1FFF00}disponible{FFFFFF})\n"); }
- else if(Jugador[playerid][Pelea3] == 0) { strcat(custom_string, "Kneehead ({FF0000}no disponible{FFFFFF})\n"); }
- if(Jugador[playerid][Pelea4] == 1) { strcat(custom_string, "Grabkick ({1FFF00}disponible{FFFFFF})\n"); }
- else if(Jugador[playerid][Pelea4] == 0) { strcat(custom_string, "Grabkick ({FF0000}no disponible{FFFFFF})\n"); }
- if(Jugador[playerid][Pelea5] == 1) { strcat(custom_string, "Elbow ({1FFF00}disponible{FFFFFF})\n"); }
- else if(Jugador[playerid][Pelea5] == 0) { strcat(custom_string, "Elbow ({FF0000}no disponible{FFFFFF})\n"); }
- ShowPlayerDialog(playerid, ESTILOPELEA2, DIALOG_STYLE_LIST,"Tus peleas",custom_string,"Aceptar","Cancelar");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement