Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DIALOG_LUTADUELO 8175
- enum lut_inf
- {
- Luta_Participando,
- Luta_DesafiadoID,
- Luta_Mandada,
- Luta_Mandaram,
- Luta_AntigoSkin,
- Float:Luta_AntigoX,
- Float:Luta_AntigoY,
- Float:Luta_AntigoZ,
- Luta_AntigoInterior,
- Luta_Aposta,
- };
- new LutaInfo[101][lut_inf];
- forward P_LutaGanhadorSpawn(playerid);
- public P_LutaGanhadorSpawn(playerid)
- {
- SetPlayerPos(playerid,LutaInfo[playerid][Luta_AntigoX],LutaInfo[playerid][Luta_AntigoY],LutaInfo[playerid][Luta_AntigoZ]);
- SetPlayerInterior(playerid,LutaInfo[playerid][Luta_AntigoInterior]);
- SetPlayerSkin(playerid,LutaInfo[playerid][Luta_AntigoSkin]);
- return 1;
- }
- /*
- AVISO!!!!!
- !!!!AVISO
- AVISO!!!!
- // Não esqueça de colocar isso em alguma parte do OnPlayerDisconnect ou OnPlayerConnect :V
- // E se quiser bloquear cmds (tipo teleporte) use
- if(LutaInfo[playerid][Luta_Participando] == 1)return SendClientMessage(playerid,red,"ERRO: Você está em um duelo!"):
- O Sistema está todo em PT-BR. Se quiser mude pra inglês.
- LutaInfo[playerid][Luta_Mandada] = 0;
- LutaInfo[playerid][Luta_DesafiadoID] = 0;
- LutaInfo[playerid][Luta_Aposta] = 0;
- LutaInfo[player1][Luta_Mandaram] = 0;
- LutaInfo[player1][Luta_Participando] = 0;
- AVISO!!!!!
- !!!!AVISO
- AVISO!!!!
- */
- CMD:luta(playerid,params[])
- {
- new player1,apostado_luta,MsgDesafioLuta[150];
- if(JogadorNoEvento[playerid] == 1)return SendClientMessage(playerid,red,"ERROR: You can not use this command in the event"); //Evento_Sistema
- if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
- if(LutaInfo[playerid][Luta_Participando] == 1)return SendClientMessage(playerid,red,"ERRO: Você já está participando de uma luta");
- if(LutaInfo[playerid][Luta_Mandada] == 1)return SendClientMessage(playerid,red,"ERRO: Você mandou recentemente um desafio. Espere que o outro jogador aceite/rejeite");
- if(sscanf(params,"ud",player1,apostado_luta))return SendClientMessage(playerid,red,"USAGE: /Luta [Playerid] [Aposta]");
- if(!IsPlayerConnected(player1))return SendClientMessage(playerid,red,"ERRO: Esse jogador não está conectado!");{
- if(LutaInfo[player1][Luta_Participando] == 1)return SendClientMessage(playerid,red,"ERRO: Esse jogador já está em uma luta e não pode ser desafiado agora");
- if(LutaInfo[player1][Luta_Mandaram] >= 1)return SendClientMessage(playerid,red,"ERRO: Alguém já desafiou esse jogador e está esperando resposta");
- if(apostado_luta <=0 && apostado_luta >=99999)return SendClientMessage(playerid,red,"ERRO: Aposta invalida");
- if(GetPlayerMoney(playerid) < apostado_luta)return SendClientMessage(playerid,red,"ERRO: Você não tem todo esse dinheiro");
- if(GetPlayerMoney(player1) < apostado_luta)return SendClientMessage(playerid,red,"ERRO: Esse jogador não tem todo esse dinheiro");
- LutaInfo[playerid][Luta_Mandada] = 1;
- LutaInfo[playerid][Luta_DesafiadoID] = player1;
- LutaInfo[playerid][Luta_Aposta] = apostado_luta;
- LutaInfo[player1][Luta_Mandaram] = playerid;
- format(MsgDesafioLuta,sizeof(MsgDesafioLuta),"|- Você desafiou \"%s\" para uma luta! espere que ele aceite ou rejeite seu desafio. -|",pName(player1));
- SendClientMessage(playerid,green,MsgDesafioLuta);
- format(MsgDesafioLuta,sizeof(MsgDesafioLuta),"\t{FF0000}Você foi desafiado!\n\n{00BFFF}%s Desafiou você para uma luta!\n{00BFFF}Aposta: %d",pName(playerid),apostado_luta);
- ShowPlayerDialog(player1,DIALOG_LUTADUELO,DIALOG_STYLE_MSGBOX,"{FF0000}Desafio Luta",MsgDesafioLuta,"Aceitar","Rejeitar");}
- return 1;
- }
- //public OnPlayerDisconnect(playerid,reason)
- //{
- //
- if(LutaInfo[playerid][Luta_Participando] == 1){
- if(LutaInfo[playerid][Luta_DesafiadoID] >=1){
- if(IsPlayerConnected(LutaInfo[playerid][Luta_DesafiadoID])){
- new player1 = LutaInfo[playerid][Luta_DesafiadoID],MsgGanhadorLuta[100],Float:QuantidadeVida,Float:QuantidadeColete;
- GivePlayerMoney(playerid,LutaInfo[playerid][Luta_Aposta]+LutaInfo[playerid][Luta_Aposta]);
- GetPlayerHealth(player1,QuantidadeVida);
- GetPlayerArmour(player1,QuantidadeColete);
- format(MsgGanhadorLuta,sizeof(MsgGanhadorLuta),"%s(%d) Ganhou a luta contra %s(%d) Vida: %f Colete: %f (Jogador saiu)",pName(player1),player1,pName(playerid),playerid,QuantidadeVida,QuantidadeColete);
- SendClientMessageToAll(green,MsgGanhadorLuta);
- LutaInfo[player1][Luta_Mandada] = 0;
- LutaInfo[player1][Luta_DesafiadoID] = 0;
- LutaInfo[player1][Luta_Aposta] = 0;
- LutaInfo[player1][Luta_Mandaram] = 0;
- LutaInfo[player1][Luta_Participando] = 0;
- SpawnPlayer(player1);
- SetTimerEx("P_LutaGanhadorSpawn",2500,false,"u",player1);}}}
- //
- // return 1;
- //}
- //public OnPlayerDeath(playerid, killerid, reason)
- //{
- //
- if(LutaInfo[playerid][Luta_Participando] == 1){
- if(LutaInfo[playerid][Luta_DesafiadoID] >=1){
- if(IsPlayerConnected(LutaInfo[playerid][Luta_DesafiadoID])){
- new player1 = LutaInfo[playerid][Luta_DesafiadoID],MsgGanhadorLuta[100],Float:QuantidadeVida,Float:QuantidadeColete;
- GivePlayerMoney(playerid,LutaInfo[playerid][Luta_Aposta]+LutaInfo[playerid][Luta_Aposta]);
- GetPlayerHealth(player1,QuantidadeVida);
- GetPlayerArmour(player1,QuantidadeColete);
- format(MsgGanhadorLuta,sizeof(MsgGanhadorLuta),"%s(%d) Ganhou a luta contra %s(%d) Vida: %f Colete: %f",pName(player1),player1,pName(playerid),playerid,QuantidadeVida,QuantidadeColete);
- SendClientMessageToAll(green,MsgGanhadorLuta);
- LutaInfo[player1][Luta_Mandada] = 0;
- LutaInfo[player1][Luta_DesafiadoID] = 0;
- LutaInfo[player1][Luta_Aposta] = 0;
- LutaInfo[player1][Luta_Mandaram] = 0;
- LutaInfo[player1][Luta_Participando] = 0;
- SpawnPlayer(player1);
- LutaInfo[playerid][Luta_Mandada] = 0;
- LutaInfo[playerid][Luta_DesafiadoID] = 0;
- LutaInfo[playerid][Luta_Aposta] = 0;
- LutaInfo[playerid][Luta_Mandaram] = 0;
- LutaInfo[playerid][Luta_Participando] = 0;
- SpawnPlayer(playerid);
- SetTimerEx("P_LutaGanhadorSpawn",2500,false,"u",player1);
- SetTimerEx("P_LutaGanhadorSpawn",2500,false,"u",playerid);}}}
- //
- // return 1;
- //}
- //public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- //{
- if(dialogid == DIALOG_LUTADUELO){
- if(!response){
- new MsgRejeitouLuta[100],player1 = LutaInfo[playerid][Luta_Mandaram];
- format(MsgRejeitouLuta,sizeof(MsgRejeitouLuta),"%s Rejeitou o seu desafio",pName(playerid));
- SendClientMessage(player1,red,MsgRejeitouLuta);
- LutaInfo[player1][Luta_Mandada] = 0;
- LutaInfo[player1][Luta_DesafiadoID] = 0;
- LutaInfo[player1][Luta_Aposta] = 0;
- LutaInfo[playerid][Luta_Mandaram] = 0;}
- if(response){
- new MsgAceitouLuta[150],player1 = LutaInfo[playerid][Luta_Mandaram];
- if(!IsPlayerConnected(player1)){
- SendClientMessage(playerid,red,"Infelizmente esse jogador não está mais conectado");
- LutaInfo[playerid][Luta_Mandaram] = 0;}else
- if(IsPlayerConnected(player1)){
- LutaInfo[playerid][Luta_AntigoSkin] = GetPlayerSkin(playerid);
- LutaInfo[player1][Luta_AntigoSkin] = GetPlayerSkin(player1);
- GetPlayerPos(playerid,LutaInfo[playerid][Luta_AntigoX],LutaInfo[playerid][Luta_AntigoY],LutaInfo[playerid][Luta_AntigoZ]);
- GetPlayerPos(player1,LutaInfo[player1][Luta_AntigoX],LutaInfo[player1][Luta_AntigoY],LutaInfo[player1][Luta_AntigoZ]);
- LutaInfo[playerid][Luta_AntigoInterior] = GetPlayerInterior(playerid);
- LutaInfo[player1][Luta_AntigoInterior] = GetPlayerInterior(player1);
- LutaInfo[player1][Luta_Mandada] = 0;
- LutaInfo[playerid][Luta_Mandada] = 0;
- LutaInfo[playerid][Luta_DesafiadoID] = player1;
- LutaInfo[playerid][Luta_Aposta] = LutaInfo[player1][Luta_Aposta];
- LutaInfo[playerid][Luta_Participando] = 1;
- LutaInfo[player1][Luta_Participando] = 1;
- format(MsgAceitouLuta,sizeof(MsgAceitouLuta),"|- Luta iniciada entre \"%s\" e \"%s\" [Aposta: %d]",pName(playerid),pName(player1),LutaInfo[playerid][Luta_Aposta]);
- SendClientMessageToAll(green,MsgAceitouLuta);
- ResetPlayerWeapons(playerid);
- ResetPlayerWeapons(player1);
- SetPlayerHealth(playerid,100);
- SetPlayerHealth(player1,100);
- SetPlayerArmour(playerid,100);
- SetPlayerArmour(player1,100);
- SetPlayerVirtualWorld(playerid,playerid);
- SetPlayerVirtualWorld(player1,playerid);
- PlayerInfo[playerid][God] = 0;
- PlayerInfo[player1][God] = 0;
- StopFly(playerid);
- RemovePlayerAttachedObject(playerid, 3);
- RemovePlayerAttachedObject(playerid, 2);
- RemovePlayerAttachedObject(playerid, 1);
- RemovePlayerAttachedObject(playerid, 0);
- StopFly(player1);
- RemovePlayerAttachedObject(player1, 3);
- RemovePlayerAttachedObject(player1, 2);
- RemovePlayerAttachedObject(player1, 1);
- RemovePlayerAttachedObject(player1, 0);
- SetPlayerPos(playerid,762.900207,8.991699,1001.163940);
- SetPlayerInterior(playerid,5);
- SetPlayerPos(player1,758.525268,13.338879,1001.163940);
- SetPlayerInterior(player1,5);
- }}}
- //
- // return 1;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement