Jump to content
  • Global

    Global

    Chatroom Rules

    • NO SE DA SOPORTE EN CHATBOX
    • NO SPAM
    • NO FLOOD

Recommended Posts

  • Usuario
Posted

Veran, hace unos dias estabamos probando mi sistema de eventos con un amigo, y cuando el pone /entrar entra al evento, pero cuando yo pongo /entrar dice que ya estoy en el evento.

 

Alguno sabe que puede ser o como se soluciona?

  • Usuario
Posted

falta reiniciar variables, debes tener una variable que comprueba q estes en el evento, reiniciala en onplayerconnect y en el cmd para salir del evento o terminarlo..

  • Usuario
Posted

yo decia, la linea del cmd que te dice que estas en evento, talves la compruebas mal. y la reiniciaste en onplayerconnect y cuando sale o termina el evento?

  • Usuario
Posted


ocmd:entrar(playerid,params[])

{

new nrandom = random(2);

//==========================================================================

if(EventoActivo == 1)

{

if(EnEvento[playerid] == 0)

{

if(nrandom == 0)

{

EnEvento[playerid] = 1;

ResetPlayerWeapons(playerid);

SetPlayerHealth(playerid, 100);

SetPlayerArmour(playerid, 100);

SetPlayerTeam(playerid,TEAM_Equipo1);

SetPlayerPos(playerid, EventXE1, EventYE1, EventZE1);

SetPlayerInterior(playerid, InteriorEvento);

SetPlayerVirtualWorld(playerid, MundoEvento);

SetPlayerSkin(playerid, SkinEquipo1);

GivePlayerWeapon(playerid, Arma1Equipo1, Municion1Equipo1);

GivePlayerWeapon(playerid, Arma2Equipo1, Municion2Equipo1);

GivePlayerWeapon(playerid, Arma3Equipo1, Municion3Equipo1);

GivePlayerWeapon(playerid, Arma4Equipo1, Municion4Equipo1);

GivePlayerWeapon(playerid, Arma5Equipo1, Municion5Equipo1);

SetPlayerColor(playerid, ColorEquipo1);

return 1;

}

else if(nrandom == 1)

{

EnEvento[playerid] = 1;

ResetPlayerWeapons(playerid);

SetPlayerHealth(playerid, 100);

SetPlayerArmour(playerid, 100);

SetPlayerTeam(playerid,TEAM_Equipo2);

SetPlayerPos(playerid, EventXE2, EventYE2, EventZE2);

SetPlayerInterior(playerid, InteriorEvento);

SetPlayerVirtualWorld(playerid, MundoEvento);

SetPlayerSkin(playerid, SkinEquipo2);

GivePlayerWeapon(playerid, Arma1Equipo2, Municion1Equipo2);

GivePlayerWeapon(playerid, Arma2Equipo2, Municion2Equipo2);

GivePlayerWeapon(playerid, Arma3Equipo2, Municion3Equipo2);

GivePlayerWeapon(playerid, Arma4Equipo2, Municion4Equipo2);

GivePlayerWeapon(playerid, Arma5Equipo2, Municion5Equipo2);

SetPlayerColor(playerid, ColorEquipo2);

return 1;

}

}

else

{

SendClientMessage(playerid,red,"ERROR: Ya estas en el evento!");

}

}

else

{

SendClientMessage(playerid,red,"ERROR: No hay ningun evento activo!");

}

return 1;

}

  • Usuario
Posted (edited)


ocmd:salir(playerid, params[])

{

if(EnEvento[playerid] == 1)

{

EnEvento[playerid] = 0;

SpawnPlayer(playerid);

SetPlayerArmour(playerid, 0);

SetPlayerInterior(playerid, 0);

SetPlayerVirtualWorld(playerid, 0);

SendClientMessage(playerid,blue,"Has salido del evento exitosamente");

}

else

{

SendClientMessage(playerid,red,"ERROR: No estas en evento!");

}

return 1;

}

Edited by LucasCarvallo
  • Usuario
Posted (edited)

Lo tengo asi

public OnPlayerConnect(playerid)
{
	EnEvento[playerid] = 0;
	//==========================================================================
Edited by LucasCarvallo
  • Usuario
Posted

Pero ya la reinicie igual mira

public OnPlayerConnect(playerid)
{
	EnEvento[playerid] = 0;
	//==========================================================================

Pero debajo de la linea esa hay mas variables establecidas a 0, esto estorba?

  • Usuario
Posted

ou sheet, no veo nada mal D:

 

prueba con usar variables booleanas, new bool:tuvariable; estas almacenan true y false, o 1 y 0 solamente, es mas simple asi pero igual deberia andar como lo estas usando, fijate tambien q en algun punto del gm le asignes el valor 1 de nuevo a la variable..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...