[Ajuda] Cancelar contrato
#1

alguem me ajuda por favor fazer algo pra hitman cancelar o contrato Cod logo abaixo : /contrato e tambem hitman nao poder faze 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 200 || moneys 2000) { SendClientMessage(playeridCOLOR_GREY"   O contrato deve ser entre R$200 a R$2000)"); 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), "<< Alguem 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;


Laptop :
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
#2

pawn Код:
if(strcmp(cmd, "/cancelarcontrato",true) == 0)
{
    new giveplayerid;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso Correto: /CancelarContrato [playerid");
    giveplayerid = strval(tmp);
    PlayerInfo[giveplayerid][pHeadValue] = 0;
    return 1;
}
Reply
#3

pawn Код:
if(!strcmp(cmd, "/cancelarcontrato",true))
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "USO: /cancelarcontrato [playerid/Parte-do-Nick]");
    giveplayerid = ReturnUser(tmp);
    PlayerInfo[giveplayerid][pHeadValue] = 0;
    return SendClientMessage(playerid, -1, "Contrato cancelado!");
}
@edit O cara do IP float foi mais rapido :/

zuera shick hsuahsuashaus
Reply
#4

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
if(!strcmp(cmd, "/cancelarcontrato",true))
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "USO: /cancelarcontrato [playerid/Parte-do-Nick]");
    giveplayerid = ReturnUser(tmp);
    PlayerInfo[giveplayerid][pHeadValue] = 0;
    return SendClientMessage(playerid, -1, "Contrato cancelado!");
}
@edit O cara do IP float foi mais rapido :/

zuera shick hsuahsuashaus
eahueuaehaue acho que vou mudar meu nick aki no forum pra IP Float heauheaueae
Reply
#5

Pow esse codigo qualker um pode usar etc.. e nao funfo pro hitman cancelar o contrato q ele atribuiu ;x tem q ter a funcao apenas pro hitman q atribuiu algum contrato e ker cancela..
Reply
#6

Qual sua Variavel Hitman?
vamos supor que seja Playerinfo[playerid][pHitman]
pawn Код:
if(PlayerInfo[playerid][pHitman] == 0) return SendClientMessage(playerid,-1,"Voce nao e Hitman");
Reply
#7

esse ai :
PHP код:
if(PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 8
Reply
#8

pawn Код:
if(strcmp(cmd, "/cancelarcontrato",true) == 0)
{
    if(PlayerInfo[playerid][pMember] != 8 || PlayerInfo[playerid][pLeader] != 8) return SendClientMessage(playerid,-1,"Voce nao e Hitman");
    new giveplayerid;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso Correto: /CancelarContrato [playerid]");
    giveplayerid = strval(tmp);
    PlayerInfo[giveplayerid][pHeadValue] = 0;
    return 1;
}
Reply
#9

Deu esse warning aki man
Код:
C:\Users\Felipe\Desktop\gmusado\gamemodes\BSL.pwn(26616) : warning 219: local variable "giveplayerid" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:          13004 bytes
Code size:          2586200 bytes
Data size:          7077176 bytes
Stack/heap size:      16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 9692764 bytes

1 Warning.
oq fasso ?
Reply
#10

Tenta por o new Giveplayerid; em cima do If.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)