warning 213: tag mismatch
#1

Hello I am having problem on this code:
PHP код:
COMMAND:hangup(playerid,params[])
{
    if(
CellPhone[playerid][talking])
    {
        if(
CellPhone[playerid][calledby])
        {
            
SendClientMessage(CellPhone[playerid][calledby], -1"Cellphone: They hung up.");
            
printf("Called by : %i"CellPhone[playerid][calledby]);
            
SendClientMessage(playerid, -1"Cellphone: You hung up.");
            
CellPhone[calledby][talking]=0;
            
CellPhone[calledby][callingto] = 0;
            
CellPhone[playerid][talking]=0;
            
CellPhone[playerid][calledby] = 0;
        }else{
            if(
CellPhone[playerid][callingto])
            {
                
printf("Calling to : %i"CellPhone[playerid][callingto]);
                
SendClientMessage(CellPhone[playerid][callingto], -1"Cellphone: They hung up.");
                
SendClientMessage(playerid, -1"Cellphone: You hung up.");
                
CellPhone[callingto][talking] = 0;
                
CellPhone[callingto][calledby] = 0;
                
CellPhone[playerid][talking] = 0;
                
CellPhone[playerid][callingto] = 0;
            }
        }
    }
    return 
1;

Error lines:
PHP код:
CellPhone[calledby][talking]=0;
CellPhone[calledby][callingto] = 0
CellPhone enum:
PHP код:
enum CellPhoneEnum{
    
calledby,
    
callingto,
    
talking,
    
talkingtime,
    
ringingtime,
    
totalring
}; 
Reply
#2

Quote:
Originally Posted by akib
Посмотреть сообщение
Hello I am having problem on this code:
PHP код:
COMMAND:hangup(playerid,params[])
{
    if(
CellPhone[playerid][talking])
    {
        if(
CellPhone[playerid][calledby])
        {
            
SendClientMessage(CellPhone[playerid][calledby], -1"Cellphone: They hung up.");
            
printf("Called by : %i"CellPhone[playerid][calledby]);
            
SendClientMessage(playerid, -1"Cellphone: You hung up.");
            
CellPhone[calledby][talking]=0;
            
CellPhone[calledby][callingto] = 0;
            
CellPhone[playerid][talking]=0;
            
CellPhone[playerid][calledby] = 0;
        }else{
            if(
CellPhone[playerid][callingto])
            {
                
printf("Calling to : %i"CellPhone[playerid][callingto]);
                
SendClientMessage(CellPhone[playerid][callingto], -1"Cellphone: They hung up.");
                
SendClientMessage(playerid, -1"Cellphone: You hung up.");
                
CellPhone[callingto][talking] = 0;
                
CellPhone[callingto][calledby] = 0;
                
CellPhone[playerid][talking] = 0;
                
CellPhone[playerid][callingto] = 0;
            }
        }
    }
    return 
1;

Error lines:
PHP код:
CellPhone[calledby][talking]=0;
CellPhone[calledby][callingto] = 0
CellPhone enum:
PHP код:
enum CellPhoneEnum{
    
calledby,
    
callingto,
    
talking,
    
talkingtime,
    
ringingtime,
    
totalring
}; 
try this:

PHP код:
CellPhone[CellPhone[playerid][calledby]][talking]=0;
CellPhone[CellPhone[playerid][calledby]][callingto] = 0
Reply
#3

Don't forget to change:

Код:
CellPhone[callingto][talking] = 0;
CellPhone[callingto][calledby] = 0;
to:

Код:
CellPhone[CellPhone[playerid][callingto]][talking] = 0;
CellPhone[CellPhone[playerid][callingto]][calledby] = 0;
as well.
Reply
#4

Thanks for your reply, Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)