[Ajuda] Armas por score
#4

O problema й sу sintaxe.
Ao invйs de usar if, use switch:
Код:
DarArmas(playerid) 
{ 
    if(IsPlayerConnected(playerid)) 
    { 
		new score = GetPlayerScore(playerid);
        switch(score){ 

        	case 0 .. 30:{

            	GivePlayerWeapon(playerid, 24, 500);
       		}
       		
       		case 31 .. 80:{ 

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 25, 500); 
			} 
        	
        	case 81 .. 150:{ 

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 25, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 
        	} 
            
            case 151 .. 230:{

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 25, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 

        	} 
           
            case 231 .. 320:{ 

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 25, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 
	            GivePlayerWeapon(playerid, 30, 1500); 
	            SetPlayerArmour(playerid, 20); 
        	}

	        case 321 .. 450:{ 

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 25, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 
	            GivePlayerWeapon(playerid, 31, 1500); 
	            SetPlayerArmour(playerid, 20);
	        }

            case 451 .. 700:{ 

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 27, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 
	            GivePlayerWeapon(playerid, 31, 1500); 
	            SetPlayerArmour(playerid, 20);
	        }

            case 701 .. 1000:{ 

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 27, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 
	            GivePlayerWeapon(playerid, 31, 1500); 
	            SetPlayerArmour(playerid, 60);
	        } 
           
            case 1001 .. 1337:{ // Gostei da referкncia

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 27, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 
	            GivePlayerWeapon(playerid, 34, 90); 
	            GivePlayerWeapon(playerid, 31, 1500); 
	            SetPlayerArmour(playerid, 60);
        	}

           	case 1337 .. 9999999:{

	            GivePlayerWeapon(playerid, 24, 500); 
	            GivePlayerWeapon(playerid, 27, 500); 
	            GivePlayerWeapon(playerid, 29, 500); 
	            GivePlayerWeapon(playerid, 34, 90); 
	            GivePlayerWeapon(playerid, 31, 1500); 
	            SetPlayerArmour(playerid, 100); 
	            GivePlayerWeapon(playerid, 37, 5); 
    		}
    	} 
    }
    
    return 1; 
}
Obs: Nгo compilei, mas deve estar tudo certo.
Obs2: Ctrl C, Ctrl V aqui no fуrum faz a identaзгo ficar louca. Quando for migrar para o seu cуdigo, arrume os erros, por favor
Reply


Messages In This Thread
Armas por score - by axellech - 29.05.2018, 20:50
Re: Armas por score - by GunnerCoder - 29.05.2018, 21:30
Re: Armas por score - by axellech - 29.05.2018, 21:40
Re: Armas por score - by Ermanhaut - 29.05.2018, 22:12
Re: Armas por score - by axellech - 29.05.2018, 23:06
Re: Armas por score - by Ermanhaut - 29.05.2018, 23:10
Re: Armas por score - by axellech - 30.05.2018, 00:02
Re: Armas por score - by Ermanhaut - 30.05.2018, 00:48
Re: Armas por score - by axellech - 30.05.2018, 01:35
Re: Armas por score - by Ermanhaut - 30.05.2018, 01:45

Forum Jump:


Users browsing this thread: 1 Guest(s)