[AJUDA]Comando -
lincon c - 18.08.2011
Boa Galera do Fуrum venho aqui persistir no msm erro Desculpem mais ja tentei de tudo nesse comando.
os 2 jogadores estao indo para o msm [time] tipo qria q ia um para cada lado mais nao esta indo alguem sabe
Код:
if(strcmp("/irevento", cmdtext, true, 10) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(EventoCriado != 1) return SendClientMessage(playerid, 0x008000AA, "| ERRO | Nгo tem evento criado!");
if(ladoA[playerid] == 1) return 1;
if(ladoA[playerid] < 1)
{
SetPlayerPos(playerid, -3554.9182,376.5091,23.3792);
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 31, 150);
GivePlayerWeapon(playerid, 34, 400);
GivePlayerWeapon(playerid, 28, 400);
GivePlayerWeapon(playerid, 24, 400);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
SetPlayerSkin(playerid,287);
TogglePlayerControllable(playerid,0);
ladoA[playerid]++;
noevento[playerid] = 1;
}
if(ladoB[playerid] == 1) return 1;
if(ladoB[playerid] < 1)
{
SetPlayerPos(playerid, -3775.4141,417.6548,22.0736); // pos da equipe B
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 31, 150);
GivePlayerWeapon(playerid, 34, 400);
GivePlayerWeapon(playerid, 28, 400);
GivePlayerWeapon(playerid, 24, 400);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
SetPlayerSkin(playerid,104);
TogglePlayerControllable(playerid,0);
ladoB[playerid]++;
noevento[playerid] = 1;
return 1;
}
if(ladoA[playerid] == 1 || ladoB[playerid] == 1) return SendClientMessage(playerid, 0x008000AA, "| INFO | O Evento ja esta lotado!");
return 1;
}
OBS: Creditos do comando a Shickcard
Tenho certeza q esta certo mais deve ter algum detalhe q nao esto percebendo
Ajuda ai pf Grato....
Re: [AJUDA]Comando -
ViniBorn - 18.08.2011
Supondo que tenham 10 jogadores, numerados de 1 a 10. Que tipo de time vocк quer, o tipo A ou B?
PHP код:
1 , 2 , 3 , 4 , 5 VERSUS 6 , 7 , 8 , 9 , 10
ou
1 , 3 , 5 , 7 , 9 VERSUS 2 , 4 , 6 , 8 , 10
Re: [AJUDA]Comando -
lincon c - 18.08.2011
Tipo A o mбximo de jogador ai no comando seria 1 para cada time entгo o primeiro q digitar o comando ir para o time A e o outro ir para o ъnico time q sobrou time B mais os 2 estгo indo para o msm time
Re: [AJUDA]Comando -
ViniBorn - 18.08.2011
pawn Код:
#define MAX_EVENTO 10 // coloque aqui o nъmero mбximo de jogadores no evento
new Lado,EmEvento; // Essa linha e a de cima vocк coloca no topo.
if(strcmp("/irevento", cmdtext, true, 10) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(EventoCriado != 1)
return SendClientMessage(playerid, 0x008000AA, "| ERRO | Nгo tem evento criado!");
if(MAX_EVENTO == EmEvento)
return SendClientMessage(playerid, 0x008000AA, "| INFO | O Evento ja esta lotado!");
if(!Lado)
{
SetPlayerPos(playerid, -3554.9182,376.5091,23.3792);
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 31, 150);
GivePlayerWeapon(playerid, 34, 400);
GivePlayerWeapon(playerid, 28, 400);
GivePlayerWeapon(playerid, 24, 400);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
SetPlayerSkin(playerid,287);
TogglePlayerControllable(playerid,0);
Lado = 1;
noevento[playerid] = 1;
}
else
{
SetPlayerPos(playerid, -3775.4141,417.6548,22.0736); // pos da equipe B
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 31, 150);
GivePlayerWeapon(playerid, 34, 400);
GivePlayerWeapon(playerid, 28, 400);
GivePlayerWeapon(playerid, 24, 400);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
SetPlayerSkin(playerid,104);
TogglePlayerControllable(playerid,0);
Lado = 0;
noevento[playerid] = 1;
}
EmEvento++;
return 1;
}
Re: [AJUDA]Comando -
lincon c - 18.08.2011
Obrigado vo testar aqui
Re: [AJUDA]Comando -
lincon c - 18.08.2011
Viniborn Funciono perfeito aqui Obrigado
Re: [AJUDA]Comando -
ViniBorn - 18.08.2011
De nada
Re: [AJUDA]Comando -
You_Tube - 18.08.2011
Dar Reputation Pro Cara U.u
Re: [AJUDA]Comando -
ViniBorn - 18.08.2011
Sу uma observaзгo.
Olhe bem pro seu cуdigo, tem vбrias funзхes que sгo exatamente iguais para os dois casos.
Ex:
pawn Код:
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 31, 150);
GivePlayerWeapon(playerid, 34, 400);
GivePlayerWeapon(playerid, 28, 400);
GivePlayerWeapon(playerid, 24, 400);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
TogglePlayerControllable(playerid,0);
Vocк pode economizar linhas deixando os cуdigos comuns fora do if e else.
Ex:
pawn Код:
#define MAX_EVENTO 10 // coloque aqui o nъmero mбximo de jogadores no evento
new Lado,EmEvento; // Essa linha e a de cima vocк coloca no topo.
if(strcmp("/irevento", cmdtext, true, 10) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(EventoCriado != 1)
return SendClientMessage(playerid, 0x008000AA, "| ERRO | Nгo tem evento criado!");
if(MAX_EVENTO == EmEvento)
return SendClientMessage(playerid, 0x008000AA, "| INFO | O Evento ja esta lotado!");
if(!Lado)
{
SetPlayerPos(playerid, -3554.9182,376.5091,23.3792);
SetPlayerSkin(playerid,287);
Lado = 1;
noevento[playerid] = 1;
}
else
{
SetPlayerPos(playerid, -3775.4141,417.6548,22.0736); // pos da equipe B
SetPlayerSkin(playerid,104);
Lado = 0;
noevento[playerid] = 1;
}
GivePlayerWeapon(playerid, 26, 400);
GivePlayerWeapon(playerid, 31, 150);
GivePlayerWeapon(playerid, 34, 400);
GivePlayerWeapon(playerid, 28, 400);
GivePlayerWeapon(playerid, 24, 400);
SetPlayerHealth(playerid,100);
SetPlayerArmour(playerid,100);
SetPlayerSkin(playerid,104);
TogglePlayerControllable(playerid,0);
EmEvento++;
return 1;
}
Respuesta: [AJUDA]Comando -
xxzim - 18.08.2011
O ViniBorn e um otimo scripter sempre me ajuda.