[Ajuda] Sistema de Duelo
#9

PHP код:
dcmd_duel(playerid,params[]) {
    if(
PlayerInfo[playerid][Level] >= 3) {
        new 
tmp[256], tmp2[256], tmp3[256], Indextmp strtok(params,Index), tmp2 strtok(params,Index), tmp3 strtok(params,Index);
        if(!
strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp) || !IsNumeric(tmp2)) {
            
SendClientMessage(playeridred"USO: /duel [player1 id] [player2 id] [localizaзгo]   (Localizaзхes: 1, 2, 3]");
            return 
SendClientMessage(playeridred"Se vocк nгo especificar uma localizaзгo o duelo ocorrerб no lugar atual");
        }
        new 
player1 strval(tmp), player2 strval(tmp2), locationstring[128];
        if(!
strlen(tmp3)) location 0; else location strval(tmp3);
        if(
PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERRO: Vocк nгo pode usar este comando neste admin");
        if(
PlayerInfo[player2][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERRO: Vocк nгo pode usar este comando neste admin");
        if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
              if(
IsPlayerConnected(player2) && player2 != INVALID_PLAYER_ID) {
                if(
InDuel[player1] == 1) return SendClientMessage(playerid,red,"ERRO: Jogador1 jб estб em um duelo");
                if(
InDuel[player2] == 1) return SendClientMessage(playerid,red,"ERRO: Jogador2 jб estб em um duelo");
        
                if(
location == 1)   {
                    
SetPlayerInterior(player1,16); SetPlayerPos(player1,-1404.0671270.37061042.8672);
                    
SetPlayerInterior(player2,16); SetPlayerPos(player2,-1395.0671261.37061042.8672);
                } else if(
location == 2)   {
                    
SetPlayerInterior(player1,0); SetPlayerPos(player1,1353.407,2188.155,11.02344); 
                    
SetPlayerInterior(player2,0); SetPlayerPos(player2,1346.255,2142.843,11.01563); 
                } else if(
location == 3)   {
                    
SetPlayerInterior(player1,10); SetPlayerPos(player1,-1041.037,1078.729,1347.678); SetPlayerFacingAngle(player1,135);
                    
SetPlayerInterior(player2,10); SetPlayerPos(player2,-1018.061,1052.502,1346.327); SetPlayerFacingAngle(player2,45);
                }
                
InDuel[player1] = 1;
                
InDuel[player2] = 1;
                
CMDMessageToAdmins(playerid,"DUEL");
                
cdt[player1] = 6;
                
SetTimerEx("Duel",1000,0,"dd"player1player2);
                
format(stringsizeof(string), "Administrador \"%s\" deu inнcio a um duelo entre \"%s\" e \"%s\" "pName(playerid), pName(player1), pName(player2) );
                
SendClientMessage(player1bluestring); SendClientMessage(player2bluestring);
                return 
SendClientMessage(playeridbluestring);
              } else return 
SendClientMessage(playeridred"Jogador2 nгo conectado");
        } else return 
SendClientMessage(playeridred"Jogador1 nгo conectado");
    } else return 
SendClientMessage(playerid,red,"ERRO: Vocк nгo tem nнvel alto suficiente para usar este comando");

Da uma olhada nesse comando talvez ele te ajude.
Crйditos: LethaL Adminscript
Reply


Messages In This Thread
Sistema de Duelo - by s4kuL - 13.12.2012, 22:19
Re: Sistema de Duelo - by ViniBorn - 13.12.2012, 22:49
Re: Sistema de Duelo - by s4kuL - 14.12.2012, 01:33
Re: Sistema de Duelo - by s4kuL - 14.12.2012, 13:57
Re: Sistema de Duelo - by s4kuL - 14.12.2012, 17:54
Re: Sistema de Duelo - by JonathanFeitosa - 14.12.2012, 17:57
Re: Sistema de Duelo - by s4kuL - 14.12.2012, 22:31
Re: Sistema de Duelo - by s4kuL - 15.12.2012, 20:40
Re: Sistema de Duelo - by Gleisson_. - 16.12.2012, 02:31
Re: Sistema de Duelo - by s4kuL - 16.12.2012, 06:28

Forum Jump:


Users browsing this thread: 1 Guest(s)