[Pedido] Sistema de Score
#1

Alguйm pode me arrumar ou ajudar a fazer um sistema de score para tdm?
Exemplo: O sistema й composto de nнveis, para alcanзa acada nнvel requer uma quantidade de Score
Como, Se do nivel 1 pro 2 precisa de 20 de score, ai quando a pessoa matar os 20, sobe de nivel e no spawn vem com novas armas.
Alguйm pode me ajudar?
Reply
#2

Seria isso ?

PHP код:
//Topo GM
new MatouNivel[MAX_PLAYERS];
public 
OnPlayerDeath(playerid, killerid, reason){
    if(
killerid != INVALID_PLAYER_ID){
        
MatouNivel[killerid] += 1;
        if(
MatouNivel[killerid] == 20){
            
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
            
MatouNivel[killerid] = 0;
        }
    }
    return 
1;
}
public 
OnPlayerSpawn(playerid){
    if(
GetPlayerScore(playerid) == 1){
        
        
//Aqui armas para o Nivel 1
    
}
    if(
GetPlayerScore(playerid) == 2){
        
//Aqui armas para o Nivel 2 e assim por diante
    
}
    return 
1;
} 
Reply
#3

Й isso mesmo.
Mais tem um porйm esse code tem que estб com score exato para ter a arma.
Tipo, digamos que o quando a pessoa estiver com 8 de score, ela receberб essas arma.
Код:
    if(GetPlayerScore(playerid) == 8){

	    GivePlayerWeapon(playerid, 24, 500);
		GivePlayerWeapon(playerid, 27, 500);
		GivePlayerWeapon(playerid, 29, 500);
		GivePlayerWeapon(playerid, 34, 90);
		GivePlayerWeapon(playerid, 31, 1500);
		SetPlayerArmour(playerid, 60);
    }
E digamos que o prуximo nнvel precisa de 15 de score.
Se a pessoa matar uma amais e ir pra 9 de score, ela fica sem arma atй chaga no 15

Код:
    if(GetPlayerScore(playerid) == 15){

	    GivePlayerWeapon(playerid, 24, 500);
		GivePlayerWeapon(playerid, 27, 500);
		GivePlayerWeapon(playerid, 29, 500);
		GivePlayerWeapon(playerid, 34, 90);
		GivePlayerWeapon(playerid, 31, 1500);
		SetPlayerArmour(playerid, 60);
    }
No caso ficarб 7 score de diferenзa para chega de 8 ao 15, e entre esses 7 score a pessoa estб ficando sem arma.
Tem como mudar isso? coloca para pessoa fica com arma do nivel anterios atй chegar no prуximo nivel?
Reply
#4

Vocк quer que quando upe de level, resete o score no caso?
Reply
#5

if(GetPlayerScore(playerid) >= 8 && GetPlayerScore(playerid) <= 15)
Reply
#6

Quote:
Originally Posted by axellech
Посмотреть сообщение
Й isso mesmo.
Mais tem um porйm esse code tem que estб com score exato para ter a arma.
Tipo, digamos que o quando a pessoa estiver com 8 de score, ela receberб essas arma.
Код:
    if(GetPlayerScore(playerid) == 8){

	    GivePlayerWeapon(playerid, 24, 500);
		GivePlayerWeapon(playerid, 27, 500);
		GivePlayerWeapon(playerid, 29, 500);
		GivePlayerWeapon(playerid, 34, 90);
		GivePlayerWeapon(playerid, 31, 1500);
		SetPlayerArmour(playerid, 60);
    }
E digamos que o prуximo nнvel precisa de 15 de score.
Se a pessoa matar uma amais e ir pra 9 de score, ela fica sem arma atй chaga no 15

Код:
    if(GetPlayerScore(playerid) == 15){

	    GivePlayerWeapon(playerid, 24, 500);
		GivePlayerWeapon(playerid, 27, 500);
		GivePlayerWeapon(playerid, 29, 500);
		GivePlayerWeapon(playerid, 34, 90);
		GivePlayerWeapon(playerid, 31, 1500);
		SetPlayerArmour(playerid, 60);
    }
No caso ficarб 7 score de diferenзa para chega de 8 ao 15, e entre esses 7 score a pessoa estб ficando sem arma.
Tem como mudar isso? coloca para pessoa fica com arma do nivel anterios atй chegar no prуximo nivel?
Deste Modo e assim por diante

PHP код:

        
switch(GetPlayerScore(playerid)){
        
            case 
1 .. 10:{ //Nivel 1 Atй o 10 Essa armas
                
GivePlayerWeapon(playerid, 24, 500);
                
GivePlayerWeapon(playerid, 27, 500);
                
GivePlayerWeapon(playerid, 29, 500);
                
GivePlayerWeapon(playerid, 34, 90);
                
GivePlayerWeapon(playerid, 31, 1500);
                
SetPlayerArmour(playerid, 60);
            }
            case 
11 .. 20:{ //Nivel 11 Atй o 20 Essa armas
            
                
GivePlayerWeapon(playerid, 24, 500);
                
GivePlayerWeapon(playerid, 27, 500);
                
GivePlayerWeapon(playerid, 29, 500);
                
GivePlayerWeapon(playerid, 34, 90);
                
GivePlayerWeapon(playerid, 31, 1500);
                
SetPlayerArmour(playerid, 60);
            }
    } 
Reply
#7

Quote:
Originally Posted by Coringa_Vilao
Посмотреть сообщение
Deste Modo e assim por diante

PHP код:

        
switch(GetPlayerScore(playerid)){
        
            case 
1 .. 10:{ //Nivel 1 Atй o 10 Essa armas
                
GivePlayerWeapon(playerid, 24, 500);
                
GivePlayerWeapon(playerid, 27, 500);
                
GivePlayerWeapon(playerid, 29, 500);
                
GivePlayerWeapon(playerid, 34, 90);
                
GivePlayerWeapon(playerid, 31, 1500);
                
SetPlayerArmour(playerid, 60);
            }
            case 
11 .. 20:{ //Nivel 11 Atй o 20 Essa armas
            
                
GivePlayerWeapon(playerid, 24, 500);
                
GivePlayerWeapon(playerid, 27, 500);
                
GivePlayerWeapon(playerid, 29, 500);
                
GivePlayerWeapon(playerid, 34, 90);
                
GivePlayerWeapon(playerid, 31, 1500);
                
SetPlayerArmour(playerid, 60);
            }
    } 
Sim й isso, mais me deu esse erro:
Код:
error 002: only a single statement (or expression) can follow each "case"
Reply
#8

Quote:
Originally Posted by CaioTJF
Посмотреть сообщение
if(GetPlayerScore(playerid) >= 8 && GetPlayerScore(playerid) <= 15)
Pow era isso mesmo, vlw mano

E obrigado por tentar ajudar Coringa Vilao
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)