14.01.2012, 03:14
Bom, decidi aprender a scriptar а algum tempo, coisa de uma semana, e scriptando um simples GM de DM com sistema de lйveis (O GM nem salva ainda pra vocкs terem uma noзгo) encontrei um problema а tentar dar armas para os players devidos aos seus respectivos lйveis:
Por algum motivo estranho que eu nгo sei, sempre que logo Ingame com 0 de score, ao invйs de meu level ser setado para 0, Ele й setado para 9 e ao inves de mim receber as armas de nivel 9, Eu recebo TODAS AS ARMAS JUNTAS, ou seja com as balas acumuladas dos outros leveis INCLUINDO as armas do level 10, que seria um flamethrower.
@Edit№: Numa tentativa de melhorar as coisas, eu salvei o modo antigo e tentei editar o sistema para este modo
Agora o Problema й outro. Eu coloquei para no OnPlayerSpawn setar o Level do player pra 1, temporariamente sу pra testar, e agora as armas estгo vindo erradas. Nгo vem a deagle nem a faca para level 1, mas sim um colete de 100 D=
pawn Код:
{
if(playerInfo [playerid][Score] > -1 || playerInfo [playerid][Score] < 30 )
playerInfo [playerid][Level] = 1;
}
{
if(playerInfo [playerid][Score] >= 30 || playerInfo [playerid][Score] < 80 )
playerInfo [playerid][Level] = 2;
}
{
if(playerInfo [playerid][Score] >= 80 || playerInfo [playerid][Score] < 150 )
playerInfo [playerid][Level] = 3;
}
{
if(playerInfo [playerid][Score] >= 150 || playerInfo [playerid][Score] < 250 )
playerInfo [playerid][Level] = 4;
}
{
if(playerInfo [playerid][Score] >= 250 || playerInfo [playerid][Score] < 350 )
playerInfo [playerid][Level] = 5;
}
{
if(playerInfo [playerid][Score] >= 350 || playerInfo [playerid][Score] < 450 )
playerInfo [playerid][Level] = 6;
}
{
if(playerInfo [playerid][Score] >= 150 || playerInfo [playerid][Score] < 550 )
playerInfo [playerid][Level] = 7;
}
{
if(playerInfo [playerid][Score] >= 550 || playerInfo [playerid][Score] < 650 )
playerInfo [playerid][Level] = 8;
}
{
if(playerInfo [playerid][Score] >= 650 || playerInfo [playerid][Score] < 1337 )
playerInfo [playerid][Level] = 9;
}
{
if(playerInfo [playerid][Score] >= 1337 )
playerInfo [playerid][Level] = 10;
}
if (playerInfo [playerid][Level] == 1
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
if (playerInfo [playerid][Level] == 2
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
if (playerInfo [playerid][Level] == 3
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
if (playerInfo [playerid][Level] == 4
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerArmour(playerid, 20);
if (playerInfo [playerid][Level] == 5
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerArmour(playerid, 20);
GivePlayerWeapon(playerid, 30, 500);
if (playerInfo [playerid][Level] == 6
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerArmour(playerid, 30);
GivePlayerWeapon(playerid, 31, 500);
if (playerInfo [playerid][Level] == 7
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerArmour(playerid, 50);
GivePlayerWeapon(playerid, 31, 500);
if (playerInfo [playerid][Level] == 8
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerArmour(playerid, 50);
GivePlayerWeapon(playerid, 31, 500);
if (playerInfo [playerid][Level] == 9
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 31, 500);
if (playerInfo [playerid][Score] > 1337)
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 29, 500);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 31, 500);
GivePlayerWeapon(playerid, 37, 500);
@Edit№: Numa tentativa de melhorar as coisas, eu salvei o modo antigo e tentei editar o sistema para este modo
pawn Код:
if(playerInfo [playerid][Level] == 1)
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 24, 500);
if(playerInfo [playerid][Level] == 2)
GivePlayerWeapon(playerid, 25, 500);
if(playerInfo [playerid][Level] == 3)
GivePlayerWeapon(playerid, 29, 500);
if(playerInfo [playerid][Level] == 4)
SetPlayerArmour(playerid, 20);
if(playerInfo [playerid][Level] == 5)
GivePlayerWeapon(playerid, 30, 500);
if(playerInfo [playerid][Level] == 6)
GivePlayerWeapon(playerid, 31, 500);
if(playerInfo [playerid][Level] == 7)
SetPlayerArmour(playerid, 50);
if(playerInfo [playerid][Level] == 8)
GivePlayerWeapon(playerid, 27, 500);
if(playerInfo [playerid][Level] == 9)
SetPlayerArmour(playerid, 100);
if(playerInfo [playerid][Level] == 10)
GivePlayerWeapon(playerid, 37, 500);