Ayuda AdminDuty
#1

Resulta que cuando estamos los administradores on y nos ponemos duty todo va bien pero al momento de ponerse off , todos los que se pongan off estan con el mismo eskin (otro diferente al duty)
como arreglo eso,puse un sistema para que cuando se ponga off vuelva al skin que tenia pero antes me funcionaba ahora no,
ejemplo el administrador 1 tiene el skin 114 off , va se pone off y vuelve a su skin que tenia voy yo me pongo off y tambien tengo ese skin ,wtf?,alguien em ayuda?

CMD:aduty(playerid) //Doesnt need params function
{
if(Info[playerid][pAdminZC] >=1 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
{
if (aDuty[playerid] == 0) //Check if player is on duty
{
new string[128];
new Float,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("", COLOR_GREEN2,x,y,z, 40.0, 0, 0); //Creates 3d text label at player position
GetPlayerPos(playerid,x,y,z); //Looks for players position
SetHP(playerid, INFINITY_HEALTH);
SetPlayerArmour(playerid, 100);
SetPlayerColor(playerid,COLOR_DRED); //set admin colour red
SetPlayerColor(playerid,COLOR_GREEN2);
skinadminantesdeduty = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 217); // Skin staff
AntiAbusos[playerid] = 1;//Cuando la variable esta en 1 dejara usar los comandos
format(string,sizeof(string), "{FFFFFF}VCRP - {0ADB34}%s Esta ahora de servicio administrativo!{FFFFFF} - {FFFFFF}VCRP",GetPlayerNameEx(playerid)); //here you format string to send to players
SendClientMessageToAll(COLOR_GREEN2,string); //send string to players
SendClientMessage(playerid,COLOR_GREEN2,"{FFFFFF}A hora estas {0ADB34}duty{FFFFFF} y no podras rolear!"); //Tell admin he is now on duty
Attach3DTextLabelToPlayer(label,playerid,0.0, 0.0, 0.7); //attach 3d text label made before to player
aDuty[playerid] = 1; //Set player on duty
}
else if (aDuty[playerid] == 1) //Check if player is on duty
{
new string[128];
new Float,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("", COLOR_WHITE,x,y,z, 40.0, 0, 0);
Delete3DTextLabel(label); //Delete 3d text label saying "Admin On Duty!"
SetPlayerHealth(playerid,100); //sets player health back to 100
SetPlayerSkin(playerid, skinadminantesdeduty);
SetPlayerColor(playerid,COLOR_WHITE);
AntiAbusos[playerid] = 0;//Cuando la variable esta en 0 NO dejara usar los comandos
format(string,sizeof(string)," {FFFFFF}VCRP - {D71C1C}%s Dejу el servicio administrativo!{FFFFFF} - {FFFFFF}VCRP",GetPlayerNameEx(playerid)); //Format string to send to players
SendClientMessageToAll(COLOR_DRED,string); //send players string
SendClientMessage(playerid, COLOR_DRED,"{FFFFFF}Dejastes de estar {D71C1C}duty{FFFFFF} ,no agas AA y a rolear se a dicho!"); //send admin message he is off duty
aDuty[playerid] = 0; //sets admin off duty
}
}
else
SendClientMessage(playerid,COLOR_DRED,"Tu no eres administrador!"); //Error message to send to players who arent admins
return 1;
}
Reply
#2

Amigo, te recomiendo que encierres todo el codigo entre [php] para facilitar la lectura

Saludos

Edito

Probб agregando esto en el cуdigo, asн es como lo tengo yo y me funciona
PHP код:
new originalskin PlayerInfo[playerid][pChar];
SetPlayerSkin(playeridoriginalskin
Saludos
Reply
#3

tenes que hacer que skinadminantesdeduty sea un array
pawn Код:
new skinadminantesdeduty[MAX_PLAYERS];
pawn Код:
skinadminantesdeduty[playerid] = GetPlayerSkin(playerid);
pawn Код:
SetPlayerSkin(skinadminantesdeduty[playerid]);
Reply
#4

Quote:
Originally Posted by Pablojpas
Посмотреть сообщение
Amigo, te recomiendo que encierres todo el codigo entre [php] para facilitar la lectura



Saludos
A Ti te recomiendo que uses [pawn] [ /pawn]
Reply
#5

En la linea de SetPlayerSkin(skinadminantesdeduty[playerid]);
me manda este error
warning 202: number of arguments does not match definition
Reply
#6

Quote:
Originally Posted by alexan12
Посмотреть сообщение
En la linea de SetPlayerSkin(skinadminantesdeduty[playerid]);
me manda este error
warning 202: number of arguments does not match definition
error mio jeje, me falto el playerid
pawn Код:
SetPlayerSkin(playerid,skinadminantesdeduty[playerid]);
Reply
#7

Gracias bro,ojala me sirva.
Reply
#8

Si, quita esa linea y ya no se va ha hacer blanco..
Reply
#9

Esque en el dyuty tengo la misma linea pero en verde asi sale nuestro nombre en verde y en el minimapa
, el problema es el off duty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)