SA-MP Forums Archive
i have problem when i F5 this code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: i have problem when i F5 this code (/showthread.php?tid=617296)



Fixed Delete - thienle7090 - 19.09.2016

Delete ......................


Re: i have problem when i F5 this code - Kaliber - 19.09.2016

You made a bracket mistake...

This code...is formatted like hell!

I am to lazy to format it right..but...look it through and somewhere you are missing an }


Re: i have problem when i F5 this code - thienle7090 - 19.09.2016

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
You made a bracket mistake...

This code...is formatted like hell!

I am to lazy to format it right..but...look it through and somewhere you are missing an }
could you help me. i really don't know how to fix


Re: i have problem when i F5 this code - Kaliber - 19.09.2016

Oh god...there are bunch of mistakes...

Try this:

PHP код:
if(dialogid == BENHVIENMAU)
    {
        if(
response)
        {
               if(
listitem == 0)
            {
                if((
PlayerInfo[playerid][pCash] <20000)) {
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                }
                else {
                    new 
Float:health;
                     
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 35 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                         return 
1;
                       }
                    else {
                        new 
Float:health;
                        
GetPlayerHealth(playerid,health);
                        if (
health 20.0)
                        {
                            
SetPlayerHealth(playerid35.0);
                            
GivePlayerMoney(playerid, -20000);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                        }
                        return 
1;
                    }
                }
            }
            if(
listitem == 1//
            
{
                if((
PlayerInfo[playerid][pCash] <30000)) {
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                }
                else {
                    new 
Float:health;
                     
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 50 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                         return 
1;
                       }
                    else {
                        new 
Float:health;
                        
GetPlayerHealth(playerid,health);
                        if (
health 45.0)
                        {
                            
SetPlayerHealth(playerid50.0);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                        }
                        return 
1;
                    }
                }
            }
            if(
listitem ==2//
            
{
                if((
PlayerInfo[playerid][pCash] <45000)) {
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                }
                else {
                    new 
Float:health;
                     
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 95 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                         return 
1;
                       }
                    else {
                        new 
Float:health;
                        
GetPlayerHealth(playerid,health);
                        if (
health 95.0)
                        {
                            
SetPlayerHealth(playerid100.0);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                        }
                        return 
1;
                    }
                }
            }
            if(
listitem ==3//
            
{
                if((
PlayerInfo[playerid][pCash] <85000)) {
                
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                }
                else {
                    new 
Float:health;
                     
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 95 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                         return 
1;
                       }
                    else {
                        new 
Float:health;
                        
GetPlayerHealth(playerid,health);
                        if (
health 95.0)
                        {
                            
SetPlayerHealth(playerid100.0);
                            
SetPlayerArmour(playerid50.0);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                        }
                        return 
1;
                        }
                }
            }
        }
    } 



Delete i fixed - thienle7090 - 19.09.2016

.......


Delete i fixed - thienle7090 - 19.09.2016

.....


Re: i have problem when i F5 this code - IceBilizard - 19.09.2016

try this

PHP код:
if(dialogid == BENHVIENMAU)
{
        if(
response)
        {
            if(
listitem == 0)
            {
                if((
PlayerInfo[playerid][pCash] <20000))
                {
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                }
                else
                {
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 35 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                          return 
1;
                    }
                    else
                    {
                        if (
health 20.0)
                        {
                            
SetPlayerHealth(playerid35.0);
                            
GivePlayerMoney(playerid, -20000);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                        }
                        return 
1;
                    }
                }
            }
            if(
listitem == 1//
            
{
                if((
PlayerInfo[playerid][pCash] <30000))
                {
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                    return 
1;
                }
                else
                {
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 50 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                          return 
1;
                    }
                    else
                    {
                        if (
health 45.0)
                        {
                            
SetPlayerHealth(playerid50.0);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                        }
                        return 
1;
                    }
                }
            }
            if(
listitem ==2//
            
{
                if((
PlayerInfo[playerid][pCash] <45000))
                {
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                    return 
1;
                }
                else
                {
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 95 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                          return 
1;
                    }
                    else
                    {
                        if (
health 95.0)
                        {
                            
SetPlayerHealth(playerid100.0);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                        }
                        return 
1;
                    }
                }
            }
            if(
listitem ==3//
            
{
                if((
PlayerInfo[playerid][pCash] <85000))
                {
                    
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"Ban khфng du tiкn dк su dung dich vu nay.");
                    return 
1;
                }
                else
                {
                    new 
Float:health;
                    
GetPlayerHealth(playeridhealth);
                    new 
hpint floatroundhealthfloatround_round );
                    if( 
hpint >= 95 )
                    {
                          
SendClientMessageEx(playeridCOLOR_GREY"Sъc khoe cua ban rвt tфt khфng nкn dung dich vu nаy nua!.");
                          return 
1;
                    }
                    else
                    {
                        if (
health 95.0)
                        {
                            
SetPlayerHealth(playerid100.0);
                            
SetPlayerArmour(playerid50.0);
                            
SendClientMessageEx(playeridCOLOR_GREY"Ban dг duoc hфi phuc.!");
                    }
                    return 
1;
                }
              }
            }
        }