|
Ahora estas dando uso 'playerid' en el public.
Ademбs esta mal, por lo que veo solo le estas mostrando el textdraw al jugador que spawnea si es admin... prueba asн Code:
new ELTIMER[MAX_PLAYERS];//defines asн
public OnPlayerRequestSpawn(playerid)
{
cuenta[playerid][cSkin] = GetPlayerSkin(playerid);
cuenta[playerid][tmpSkin] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, cuenta[playerid][cSkin]);
SetPlayerSkin(playerid, cuenta[playerid][tmpSkin]);
cuenta[playerid][request] = REQUEST_INGRESO;
for(new i; i<MAX_PLAYERS; i++)
{
if(cuenta[i][cAdmin]) //Esto indica que sн la variable de administrador estб seteada a un nъmero mayor que 0 ejecutarб esas funciones.
{
KillTimer(ELTIMER[i]);
new Nombrex[MAX_PLAYER_NAME],string[25];
GetPlayerName(playerid,Nombrex,sizeof(Nombrex));
format(string,sizeof(string),"%s",Nombrex);
TextDrawSetString(Conexion1,string);
TextDrawSetPreviewModel(Conexion3, GetPlayerSkin(playerid));
TextDrawShowForPlayer(i, Conexion0);
TextDrawShowForPlayer(i, Conexion1);
TextDrawShowForPlayer(i, Conexion2);
TextDrawShowForPlayer(i, Conexion3);
ELTIMER[i] = SetTimer("TIMEFIX",5000,true,"i",i);
}
}
return 1;
}
forward TIMEFIX(playerid);
public TIMEFIX(playerid)
{
TextDrawHideForPlayer(playerid, Conexion0);
TextDrawHideForPlayer(playerid, Conexion1);
TextDrawHideForPlayer(playerid, Conexion2);
TextDrawHideForPlayer(playerid, Conexion3);
return 1;
}
|
public OnPlayerRequestSpawn(playerid)
{
cuenta[playerid][cSkin] = GetPlayerSkin(playerid);
cuenta[playerid][tmpSkin] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, cuenta[playerid][cSkin]);
SetPlayerSkin(playerid, cuenta[playerid][tmpSkin]);
cuenta[playerid][request] = REQUEST_INGRESO;
for(new i; i<MAX_PLAYERS; i++)
{
if(cuenta[i][cAdmin])
{
KillTimer(ELTIMER[i]);
new Nombrex[MAX_PLAYER_NAME],string[25];
GetPlayerName(playerid,Nombrex,sizeof(Nombrex));
format(string,sizeof(string),"%s",Nombrex);
TextDrawSetString(Conexion1,string);
TextDrawSetPreviewModel(Conexion3, GetPlayerSkin(playerid));
TextDrawShowForPlayer(i, Conexion0);
TextDrawShowForPlayer(i, Conexion1);
TextDrawShowForPlayer(i, Conexion2);
TextDrawShowForPlayer(i, Conexion3);
ELTIMER[i] = SetTimer("TIMEFIX",5000,true,"i",i);//ERROR ACA
}
}//Y ACA TAMBIEN ME DA
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
cuenta[playerid][cSkin] = GetPlayerSkin(playerid);
cuenta[playerid][tmpSkin] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, cuenta[playerid][cSkin]);
SetPlayerSkin(playerid, cuenta[playerid][tmpSkin]);
cuenta[playerid][request] = REQUEST_INGRESO;
for(new i; i<MAX_PLAYERS; i++)
{
if(cuenta[i][cAdmin])
{
KillTimer(ELTIMER[i]);
new Nombrex[MAX_PLAYER_NAME],string[25];
GetPlayerName(playerid,Nombrex,sizeof(Nombrex));
format(string,sizeof(string),"%s",Nombrex);
TextDrawSetString(Conexion1,string);
TextDrawSetPreviewModel(Conexion3, GetPlayerSkin(playerid));
TextDrawShowForPlayer(i, Conexion0);
TextDrawShowForPlayer(i, Conexion1);
TextDrawShowForPlayer(i, Conexion2);
TextDrawShowForPlayer(i, Conexion3);
ELTIMER[i] = SetTimerEx("TIMEFIX",5000,true,"i",i);
}
}
return 1;
}
|
Me equivoque en 'SetTimer', era 'SetTimerEx'..
Code:
public OnPlayerRequestSpawn(playerid)
{
cuenta[playerid][cSkin] = GetPlayerSkin(playerid);
cuenta[playerid][tmpSkin] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, cuenta[playerid][cSkin]);
SetPlayerSkin(playerid, cuenta[playerid][tmpSkin]);
cuenta[playerid][request] = REQUEST_INGRESO;
for(new i; i<MAX_PLAYERS; i++)
{
if(cuenta[i][cAdmin])
{
KillTimer(ELTIMER[i]);
new Nombrex[MAX_PLAYER_NAME],string[25];
GetPlayerName(playerid,Nombrex,sizeof(Nombrex));
format(string,sizeof(string),"%s",Nombrex);
TextDrawSetString(Conexion1,string);
TextDrawSetPreviewModel(Conexion3, GetPlayerSkin(playerid));
TextDrawShowForPlayer(i, Conexion0);
TextDrawShowForPlayer(i, Conexion1);
TextDrawShowForPlayer(i, Conexion2);
TextDrawShowForPlayer(i, Conexion3);
ELTIMER[i] = SetTimerEx("TIMEFIX",5000,true,"i",i);
}
}
return 1;
}
|