[Erro]Comandos evento. -
Matheus_Vieira - 08.11.2011
Qual й o erro nos comandos abaixo.
Se alguem me explicar eu arrumo pois ja tenho uma noзгo.
PHP код:
//==============================================================================
if(strcmp(cmdtext,"/einiciar",true)==0)
{
if(EventoCriado == 1)
{
SendClientMessage(playerid,0xb9d26eff,"Um Evento jб foi criado,espere terminar para criar outro.");
return 1;
}
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
guerra = GangZoneCreate(X-100,Y-100,X+100,Y+100);
GangZoneShowForAll(guerra,COLOR_RED);
GangZoneFlashForAll(guerra,COLOR_BLUE);
SetTimer("guerrat",60000,1);
EventoCriado = 1;
format(string, sizeof string, "O administrador %s abriu o evento (/irevento)", sendername);
SendClientMessageToAll(COLOR_YELLOW,AdminNome);
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/eparar",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
if(EventoCriado == 0)
{
SendClientMessage(playerid,0xb9d26eff,"Nenhum evento aberto!");
return 1;
}
EventoCriado = 0;
SendClientMessage(playerid,0x3321FFFF,"Evento Terminado!");
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/etrancar",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
if(EventoCriado == 0)
{
SendClientMessage(playerid,0xb9d26eff,"Evento trancado");
return 1;
}
EventoCriado = 0;
SendClientMessage(playerid,0x3321FFFF,"Evento trancado!");
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/irevento",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
ShowPlayerDialog(playerid,509,DIALOG_STYLE_MSGBOX,"Eventos","Obrigado por vir ate esse evento","Ok","Cancelar");
new Float:x, Float:y, Float:z;
SetPlayerPos(playerid, x+5, y, z);
}
else
{
SendClientMessage(playerid,0x3321FFFF,"Nenhum evento aberto!");
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/evida",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
if(EventoCriado == 1)
{
SetPlayerHealth(playerid, 100);
}
else
{
SendClientMessage(playerid,0x3321FFFF,"Nenhum evento aberto!");
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/ecolete",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
if(EventoCriado == 1)
{
SetPlayerArmour(playerid, 100);
}
else
{
SendClientMessage(playerid,0x3321FFFF,"Nenhum evento aberto!");
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/earma",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
if(EventoCriado == 1)
{
GivePlayerWeapon(playerid, 25, 700);
GivePlayerWeapon(playerid, 24, 700);
GivePlayerWeapon(playerid, 3, 700);
GivePlayerWeapon(playerid, 31, 700);
GivePlayerWeapon(playerid, 29, 700);
GivePlayerWeapon(playerid, 41, 700);
GivePlayerWeapon(playerid, 17, 700);
GivePlayerWeapon(playerid, 34, 700);
GivePlayerWeapon(playerid, 42, 700);
}
else
{
SendClientMessage(playerid,0x3321FFFF,"Nenhum evento aberto!");
}
return 1;
}
Re: [Erro]Comandos evento. -
Kuddy - 08.11.2011
Que erro estб dando?
Poste os erros, facilita aqui pragente ._.
Re: [Erro]Comandos evento. -
humildadeforever - 08.11.2011
Retirei os erros, que eram muitos. Vocк nгo estб sabendo usar a chave de fechar > }. Vocк fechou onde nгo deveria e isso provocou erros. Tб ae:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256],sendername[MAX_PLAYER_NAME],guerra;
if(strcmp(cmdtext,"/einiciar",true)==0)
{
if(EventoCriado == 1) return SendClientMessage(playerid,0xb9d26eff,"Um Evento jб foi criado,espere terminar para criar outro.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -8, "Vocк nгo tem autorizaзгo para usar esse comando.");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
guerra = GangZoneCreate(X-100,Y-100,X+100,Y+100);
GangZoneShowForAll(guerra,-7);
GangZoneFlashForAll(guerra,-7);
SetTimer("guerrat",60000,1);
EventoCriado = 1;
format(string, sizeof string, "O administrador %s abriu o evento (/irevento)", sendername);
SendClientMessageToAll(-8,string);
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/eparar",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para usar esse comando.");
if(EventoCriado == 0) return SendClientMessage(playerid,0xb9d26eff,"Nenhum evento aberto!");
EventoCriado = 0;
SendClientMessage(playerid,0x3321FFFF,"Evento Terminado!");
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/etrancar",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para usar esse comando.");
if(EventoCriado == 0) return SendClientMessage(playerid,0xb9d26eff,"Evento trancado");
EventoCriado = 0;
SendClientMessage(playerid,0x3321FFFF,"Evento trancado!");
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/irevento",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para usar esse comando.");
ShowPlayerDialog(playerid,509,DIALOG_STYLE_MSGBOX,"Eventos","Obrigado por vir ate esse evento","Ok","Cancelar");
new Float:x, Float:y, Float:z;
SetPlayerPos(playerid, x+5, y, z);
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/evida",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para usar esse comando.");
if(EventoCriado == 1) {
SetPlayerHealth(playerid, 100); }
else
{
SendClientMessage(playerid,0x3321FFFF,"Nenhum evento aberto!");
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/ecolete",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para usar esse comando.");
if(EventoCriado == 1)
{
SetPlayerArmour(playerid, 100);
}
else
{
SendClientMessage(playerid,0x3321FFFF,"Nenhum evento aberto!");
}
return 1;
}
//==============================================================================
if(strcmp(cmdtext,"/earma",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para usar esse comando.");
if(EventoCriado == 1)
{
GivePlayerWeapon(playerid, 25, 700);
GivePlayerWeapon(playerid, 24, 700);
GivePlayerWeapon(playerid, 3, 700);
GivePlayerWeapon(playerid, 31, 700);
GivePlayerWeapon(playerid, 29, 700);
GivePlayerWeapon(playerid, 41, 700);
GivePlayerWeapon(playerid, 17, 700);
GivePlayerWeapon(playerid, 34, 700);
GivePlayerWeapon(playerid, 42, 700);
}
else
{
SendClientMessage(playerid,0x3321FFFF,"Nenhum evento aberto!");
}
return 1;
}
return 0;
}
Respuesta: [Erro]Comandos evento. -
Matheus_Vieira - 08.11.2011
vlw mano, to aprendendo essa parte. Vlw bjs t+
Re: [Erro]Comandos evento. -
humildadeforever - 08.11.2011
E olha sу, veja bem o seu comando de ir ao evento.
pawn Код:
if(strcmp(cmdtext,"/irevento",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, -1, "Vocк nгo tem autorizaзгo para usar esse comando.");
ShowPlayerDialog(playerid,509,DIALOG_STYLE_MSGBOX,"Eventos","Obrigado por vir ate esse evento","Ok","Cancelar");
new Float:x, Float:y, Float:z;
SetPlayerPos(playerid, x+5, y, z);
return 1;
}
O que vocк quis fazer, criando as Float e depois setando o player pra lб, e adicionando 5 na coordenada X? 
O certo nгo seria pegar a coordenada de algum player ou mandar o player pro local do evento sem criar float?