06.04.2012, 21:43
Olб galera do samp, depois de muito tempo voltei aqui para pedir ajuda com um problema. Quero fazer algo que se uma equiper jб tiver mais membros que outra, nгo ter como entrar nela, eu jб andei meio caminho, mas nгo consigo terminar. Seguinte:
Eu coloquei no inнcio:
Coloquei pra quando o GM fechar
Ta beleza, checa de boa quando o player escolhe a class e quando spawn, mas quando ele morrer e spawnar de novo, vai novamente setar a variavйl pra "+1".
Como eu arrumo isso?
A partir de agora jб agradeзo!
Eu coloquei no inнcio:
pawn Код:
new MembrosP;
new MembrosB;
pawn Код:
public OnGameModeExit()
{
MembrosP = 0;
MembrosB = 0;
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
MembrosP --;
MembrosB --;
return 1;
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
SetPlayerTeamFromClass(playerid,classid);
if(classid == 0 || classid == 1) {
GameTextForPlayer(playerid,"~b~PESCADORES ~w~TEAM",1000,5);
if(MembrosP > MembrosB) return SetPlayerHealth(playerid, 0), ForceClassSelection(playerid);
} else if(classid == 2 || classid == 3 || classid == 4 || classid == 5) {
GameTextForPlayer(playerid,"~r~BIKERS ~w~TEAM",1000,5);
if(MembrosB > MembrosP) return SetPlayerHealth(playerid, 0), ForceClassSelection(playerid);
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
if(gTeam[playerid] == TEAM_PESCADORES) {
MembrosP ++;
if(MembrosP > MembrosB) return ForceClassSelection(playerid), SetPlayerHealth(playerid, 0),SendClientMessage(playerid, COLOR_YELLOW, "Escolha outra equipe!");
Objetivo1 = TextDrawCreate(8.0000,140.0000,"Os Bikers estao chegando. Proteja nosso precioso Vortex!");
TextDrawUseBox(Objetivo1, 1);
TextDrawBoxColor(Objetivo1,0x0F0000FF);
TextDrawTextSize(Objetivo1, 228.0000, 122.0000);
TextDrawAlignment(Objetivo1, 1);
TextDrawColor(Objetivo1,0xFAFAFAFF);
TextDrawFont(Objetivo1, 1);
TextDrawSetProportional(Objetivo1, 1);
TextDrawLetterSize(Objetivo1, 0.5099,1.5000);
TextDrawShowForPlayer(playerid, Objetivo1);
SetTimer("Pescador", 7000, false);
}
else if(gTeam[playerid] == TEAM_BIKERS) {
MembrosB ++;
if(MembrosB > MembrosP) return ForceClassSelection(playerid), SetPlayerHealth(playerid, 0), SendClientMessage(playerid, COLOR_YELLOW, "Escolha outra equipe!");
Objetivo2 = TextDrawCreate(8.0000,140.0000,"Roube o Vortex dos inocentes pescadores e o traga para o galpao secreto.");
TextDrawUseBox(Objetivo2, 1);
TextDrawBoxColor(Objetivo2,0x0F0000FF);
TextDrawTextSize(Objetivo2, 201.0000, 122.0000);
TextDrawAlignment(Objetivo2, 1);
TextDrawColor(Objetivo2,0xFAFAFAFF);
TextDrawFont(Objetivo2, 1);
TextDrawSetProportional(Objetivo2, 1);
TextDrawLetterSize(Objetivo2, 0.5099,1.5000);
TextDrawShowForPlayer(playerid, Objetivo2);
SetTimer("Biker", 7000, false);
//SetPlayerWorldBounds(playerid,2444.4185,1687.5696,631.2963,-454.9898);
}
return 1;
}
Como eu arrumo isso?
A partir de agora jб agradeзo!