////Newґs////// new Text:Textdraw0; new Text:Textdraw1; new Text:Textdraw2; new Text:Textdraw3; //Timer. new ELTIMER; public OnGameModeInit(){ Textdraw0 = TextDrawCreate(205.999969, 244.166519, "usebox"); TextDrawLetterSize(Textdraw0, 0.000000, 5.683330); TextDrawTextSize(Textdraw0, -7.599998, 0.000000); TextDrawAlignment(Textdraw0, 1); TextDrawColor(Textdraw0, 0); TextDrawUseBox(Textdraw0, true); TextDrawBoxColor(Textdraw0, 102); TextDrawSetShadow(Textdraw0, 0); TextDrawSetOutline(Textdraw0, 0); TextDrawFont(Textdraw0, 0); Textdraw1 = TextDrawCreate(59.999969, 247.893234, "New Textdraw"); TextDrawLetterSize(Textdraw1, 0.349200, 2.100265); TextDrawAlignment(Textdraw1, 1); TextDrawColor(Textdraw1, -1); TextDrawSetShadow(Textdraw1, 0); TextDrawSetOutline(Textdraw1, 1); TextDrawBackgroundColor(Textdraw1, 51); TextDrawFont(Textdraw1, 3); TextDrawSetProportional(Textdraw1, 1); Textdraw2 = TextDrawCreate(55.199977, 278.506500, "~>~Se a ~g~conectado"); TextDrawLetterSize(Textdraw2, 0.321197, 1.226665); TextDrawAlignment(Textdraw2, 1); TextDrawColor(Textdraw2, -1); TextDrawSetShadow(Textdraw2, 0); TextDrawSetOutline(Textdraw2, 1); TextDrawBackgroundColor(Textdraw2, 51); TextDrawFont(Textdraw2, 2); TextDrawSetProportional(Textdraw2, 1); Textdraw3 = TextDrawCreate(2.399998, 247.146606, " textdraw "); TextDrawBackgroundColor(Textdraw3, 0); TextDrawFont(Textdraw3, 5); TextDrawLetterSize(Textdraw3,0.398999, 1.587999); TextDrawColor(Textdraw3, -1); TextDrawSetOutline(Textdraw3, 0); TextDrawSetProportional(Textdraw3, 1); TextDrawTextSize(Textdraw3, 47.200000, 53.760009); return 1; } public OnPlayerRequestSpawn(playerid) { KillTimer(ELTIMER); TextDrawSetPreviewModel(Textdraw3, GetPlayerSkin(playerid)); TextDrawShowForAll( Textdraw0 ); TextDrawShowForAll( Textdraw1 ); TextDrawShowForAll( Textdraw2 ); TextDrawShowForAll( Textdraw3 ); new Nombre[MAX_PLAYER_NAME],string[25]; GetPlayerName(playerid,Nombre,sizeof(Nombre)); format(string,sizeof(string),"%s",Nombre); TextDrawSetString(Textdraw1,string); ELTIMER = SetTimer("TIMEFIX",5000,true); return 1; } forward TIMEFIX(playerid); public TIMEFIX(playerid) { TextDrawHideForAll( Textdraw0 ); TextDrawHideForAll( Textdraw1 ); TextDrawHideForAll( Textdraw2 ); TextDrawHideForAll( Textdraw3 ); return 1; }
public OnPlayerRequestSpawn(playerid)
{
if(TъVariabledeAdmin[playerid] != 0) //Esto indica que sн la variable de administrador estб seteada a un nъmero mayor que 0 ejecutarб esas funciones.
{
KillTimer(ELTIMER);
new Nombre[MAX_PLAYER_NAME],string[25];
GetPlayerName(playerid,Nombre,sizeof(Nombre));
format(string,sizeof(string),"%s",Nombre);
TextDrawSetString(Textdraw1,string);
TextDrawSetPreviewModel(Textdraw3, GetPlayerSkin(playerid));
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawShowForPlayer(playerid, Textdraw2);
TextDrawShowForPlayer(playerid, Textdraw3);
ELTIMER = SetTimer("TIMEFIX",5000,true);
}
return 1;
}
forward TIMEFIX(playerid);
public TIMEFIX(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw0);
TextDrawHideForPlayer(playerid, Textdraw1);
TextDrawHideForPlayer(playerid, Textdraw2);
TextDrawHideForPlayer(playerid, Textdraw3);
return 1;
}
Solamente basta con poner un simple condicional que checkee si el usuario tiene la variable de administrador mayor que 0 y ejecutarб las funciones que pongas.
PHP код:
|
public OnPlayerRequestSpawn(playerid) { cuenta[playerid][pSkin] = GetPlayerSkin(playerid); cuenta[playerid][tmpSkin] = GetPlayerSkin(playerid); SetPlayerSkin(playerid, cuenta[playerid][pSkin]); SetPlayerSkin(playerid, cuenta[playerid][tmpSkin]); cuenta[playerid][request] = REQUEST_INGRESO; if(cuenta[playerid][cAdmin]) //Esto indica que sн la variable de administrador estб seteada a un nъmero mayor que 0 ejecutarб esas funciones. { KillTimer(Eltimer); TextDrawSetPreviewModel(Conexion3, GetPlayerSkin(playerid)); TextDrawShowForAll(Conexion0); TextDrawShowForAll(Conexion1); TextDrawShowForAll(Conexion2); TextDrawShowForAll(Conexion3); new Nombrex[MAX_PLAYER_NAME],string[25]; GetPlayerName(playerid,Nombrex,sizeof(Nombrex)); format(string,sizeof(string),"%s",Nombrex); TextDrawSetString(Conexion1,string); Eltimer = SetTimer("TimeFix",2000,true); return 1; }
public OnPlayerRequestSpawn(playerid)
{
cuenta[playerid][pSkin] = GetPlayerSkin(playerid);
cuenta[playerid][tmpSkin] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, cuenta[playerid][pSkin]);
SetPlayerSkin(playerid, cuenta[playerid][tmpSkin]);
cuenta[playerid][request] = REQUEST_INGRESO;
if(cuenta[playerid][cAdmin]) //Esto indica que sн la variable de administrador estб seteada a un nъmero mayor que 0 ejecutarб esas funciones.
{
KillTimer(Eltimer);
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(playerid, Conexion0);
TextDrawShowForPlayer(playerid, Conexion1);
TextDrawShowForPlayer(playerid, Conexion2);
TextDrawShowForPlayer(playerid, Conexion3);
Eltimer = SetTimer("TimeFix",2000,true);
}
return 1;
}
forward TimeFix(playerid);
public TimeFix(playerid)
{
TextDrawHideForPlayer(playerid, Conexion0);
TextDrawHideForPlayer(playerid, Conexion1);
TextDrawHideForPlayer(playerid, Conexion2);
TextDrawHideForPlayer(playerid, Conexion3);
return 1;
}
Pandz Eso Es Muy Feo Que Solo Los Admin Puedan Verlo Ademas la Mayoria de los admin solo estan pendiente a los jugadores raro y aveces afk
|
public OnPlayerRequestSpawn(playerid)
{
cuenta[playerid][pSkin] = GetPlayerSkin(playerid);
cuenta[playerid][tmpSkin] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, cuenta[playerid][pSkin]);
SetPlayerSkin(playerid, cuenta[playerid][tmpSkin]);
cuenta[playerid][request] = REQUEST_INGRESO;
if(cuenta[playerid][cAdmin]) //Esto indica que sн la variable de administrador estб seteada a un nъmero mayor que 0 ejecutarб esas funciones.
{
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(playerid, Conexion0);
TextDrawShowForPlayer(playerid, Conexion1);
TextDrawShowForPlayer(playerid, Conexion2);
TextDrawShowForPlayer(playerid, Conexion3);
SetTimerEx("TimeFix", 2000, false, "i", playerid);
}
return 1;
}