[Ajuda]
#1

Ola a org hitman tem o esquema de atribuir contrato e tals sу que eu keria um comando /cancelarcontrato ID e cancela alguem q atribuiu o contrato se alguem conseguir faze eu agradeзo Codigo do /contrato :
PHP код:
if(strcmp(cmd"/contrato",true) == 0)
    {
        if(
IsPlayerConnected(playerid))
           {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USO: /contrato [playerid/Parte-do-Nick] [amount]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USO: /contrato [playerid/Parte-do-Nick] [amount]");
                return 
1;
            }
            
moneys strval(tmp);
            if(
moneys 100 || moneys 10000) { SendClientMessage(playeridCOLOR_GREY"   O contrato deve ser entre R$100 a R$10000)"); return 1; }
            if (
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    if(
PlayerInfo[giveplayerid][pMember] == && PlayerInfo[playerid][pMember] == 8)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo pode fazer contrato em um Assassino.");
                        return 
1;
                    }
                    if(
PlayerInfo[giveplayerid][pAdmin] >= 1)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo pode fazer contrato em um Admin.");
                        return 
1;
                    }
                    else if(
PlayerInfo[giveplayerid][pLeader] == && PlayerInfo[playerid][pMember] == 8)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo pode criar os contratos sobre o lнder.");
                        return 
1;
                    }
                    else if(
PlayerInfo[giveplayerid][pMember] == 8||PlayerInfo[giveplayerid][pLeader] == 8)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo pode fazer contrato em um Assassino !");
                        return 
1;
                    }
                    if(
gTeam[giveplayerid] == && moneys != 1000)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"   Contrato para cabeзa de policiais somente no valor de R$1000.");
                        return 
1;
                    }
                    if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_GREY"Vocк nгo pode fazer um contrato sobre si mesmo."); return 1; }
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    
playermoney GetPlayerGP(playerid);
                    if (
moneys && playermoney >= moneys)
                    {
                        
GivePlayerGP(playerid, (moneys));
                        
PlayerInfo[giveplayerid][pHeadValue]+=moneys;
                        
format(stringsizeof(string), "<< %s criou um contrato sobre %s, por R$ %d. >>",sendernamegiveplayermoneys);
                        
SendFamilyMessage(8COLOR_YELLOWstring);
                        
format(stringsizeof(string), "Vocк criou um contrato sobre %s, por R$ %d.",giveplayermoneys);
                        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                        
PlayerPlaySound(playerid10520.00.00.0);
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"   O valor de transiзгo do contrato estб invбlido.");
                    }
                }
            }
            else
            {
                
format(stringsizeof(string), "   %d nгo й um ID vбlido"giveplayerid);
                
SendClientMessage(playeridCOLOR_GRAD1string);
            }
        }
        return 
1;
    }
    return 
1;

Reply
#2

poste o cmd de aceitar o contrato (talvez seja o /laptop)
Reply
#3

Ta ae :
PHP код:
if(strcmp(cmd,"/laptop",true)==0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 8)
            {
                if(
ConnectedToPC[playerid] == 255)
                {
                    
SendClientMessage(playeridCOLOR_LIGHTBLUE"Vocк desligou seu Laptop, e desconectou da Agкncia.");
                    
ConnectedToPC[playerid] = 0;
                    return 
1;
                }
                new 
mtext[20];
                new 
yearmonth,day;
                
getdate(yearmonthday);
                if(
month == 1) { mtext "Janeiro"; }
                else if(
month == 2) { mtext "Fevereiro"; }
                else if(
month == 3) { mtext "Marзo"; }
                else if(
month == 4) { mtext "Abril"; }
                else if(
month == 5) { mtext "Maio"; }
                else if(
month == 6) { mtext "Junho"; }
                else if(
month == 7) { mtext "Julho"; }
                else if(
month == 8) { mtext "Agosto"; }
                else if(
month == 9) { mtext "Setembro"; }
                else if(
month == 10) { mtext "Outubro"; }
                else if(
month == 11) { mtext "Novembro"; }
                else if(
month == 12) { mtext "Dezembro"; }
                new 
hour,minuite,second;
                  
gettime(hour,minuite,second);
                
FixHour(hour);
                  
hour shifthour;
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
SendClientMessage(playeridCOLOR_LIGHTBLUE"Vocк abriu seu Laptop, e conectou а Agкncia.");
                
SendClientMessage(playeridCOLOR_WHITE"|--Agкncia Assassino--|");
                
SendClientMessage(playeridCOLOR_WHITE"|-Noticias-|");
                
SendClientMessage(playeridCOLOR_WHITE"|-Contratos-|");
                
SendClientMessage(playeridCOLOR_WHITE"|-Atribuir-|");
                
SendClientMessage(playeridCOLOR_WHITE"|-Cargos-|");
                
SendClientMessage(playeridCOLOR_WHITE"|-Logout-|");
                
format(stringsizeof(string), "Mкs: %s | Dia: %d | Hora: %d:%d |"mtextdayhour+1minuite);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
ConnectedToPC[playerid] = 255;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo й um Hitman !");
                return 
1;
            }
        }
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)