SA-MP Forums Archive
[FilterScript] Textdraw de skin en conecciуn. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+----- Forum: Lanzamientos/Releases (https://sampforum.blast.hk/forumdisplay.php?fid=59)
+----- Thread: [FilterScript] Textdraw de skin en conecciуn. (/showthread.php?tid=617468)

Pages: 1 2


Respuesta: Textdraw de skin en conecciуn. - Pandz - 25.06.2017

Quote:
Originally Posted by FixFl0w
View Post
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;
}
Cуdigo hecho desde el celular, avisas si hay error.
Me da errores gg
HTML 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] = SetTimer("TIMEFIX",5000,true,"i",i);//ERROR ACA
    	}
    	}//Y ACA TAMBIEN ME DA
   	return 1;
}



Respuesta: Textdraw de skin en conecciуn. - FixFl0w - 25.06.2017

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;
}



Respuesta: Textdraw de skin en conecciуn. - Pandz - 25.06.2017

Quote:
Originally Posted by FixFl0w
View Post
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;
}
GRACIAS