CMD:crearatm(playerid, params[])
{
if(Info[playerid][pAdmin] != 7) return SendClientMessageEx(playerid, COLOR_GREY, "* No puedes usar este comando.");
if(!IsPlayerConnectedEx(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, NoConectado);
if(Info[playerid][pAdmin] != 7)
{
new atmid;
if(!sscanf(params, "d", atmid))
{
if(atmid < 0 || atmid > MAX_ATMS) return SendClientMessageEx( playerid, COLOR_GREY, "* ID de ATM invбlida.");
if(atmVariables[atmid][atmMoney] > 0) return SendClientMessageEx( playerid, COLOR_GREY, "* Esta ID estб siendo utilizada.");
GetPlayerPos(playerid, atmVariables[atmid][fATMPos][0], atmVariables[atmid][fATMPos][1], atmVariables[atmid][fATMPos][2]);
GetPlayerFacingAngle(playerid, atmVariables[atmid][fATMPosRot]);
DestroyDynamicObject(atmVariables[atmid][rObjectId]);
atmVariables[atmid][rObjectId] = CreateDynamicObject(2942,atmVariables[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2]-0.4,0,0,atmVariables[atmid][fATMPosRot]);
new text[40];
format(text,sizeof(text),"%d\nIngresa tu tarjeta usando /atm.",atmid);
DestroyDynamic3DTextLabel(Text3D:atmVariables[atmid][rTextLabel]);
atmVariables[atmid][rTextLabel] = CreateDynamic3DTextLabel(text,COLOR_YELLOW,atmVariables[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2],8.0);
atmVariables[atmid][atmMoney] = 0;
SendClientMessageEx(playerid, COLOR_WHITE, "Creaste satisfactoriamente el ATM indicado.");
atmSave();
}
else return SendClientMessageEx(playerid, COLOR_GREY, "USA: /crearatm [ID Libre]!");
}
else SendClientMessageEx(playerid, COLOR_GREY, "* No puedes usar este comando.");
return 1;
}
CMD:crearatm(playerid, params[])
{ if(!IsPlayerConnectedEx(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, NoConectado); if(Info[playerid][pAdmin] < 7) return SendClientMessageEx(playerid, COLOR_GREY, "* No puedes usar este comando."); new atmid; if(!sscanf(params, "d", atmid)) { if(atmid < 0 || atmid > MAX_ATMS) return SendClientMessageEx( playerid, COLOR_GREY, "* ID de ATM invбlida."); if(atmVariables[atmid][atmMoney] > 0) return SendClientMessageEx( playerid, COLOR_GREY, "* Esta ID estб siendo utilizada."); GetPlayerPos(playerid, atmVariables[atmid][fATMPos][0], atmVariables[atmid][fATMPos][1], atmVariables[atmid][fATMPos][2]); GetPlayerFacingAngle(playerid, atmVariables[atmid][fATMPosRot]); DestroyDynamicObject(atmVariables[atmid][rObjectId]); atmVariables[atmid][rObjectId] = CreateDynamicObject(2942,atmVariables[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2]-0.4,0,0,atmVariables[atmid][fATMPosRot]); new text[40]; format(text,sizeof(text),""COL_GENERAL"[ATM ID: "COL_WHITE"%d"COL_GENERAL"]\n"COL_WHITE"Ingresa tu tarjeta usando '/atm'.",atmid); DestroyDynamic3DTextLabel(Text3D:atmVariables[atmid][rTextLabel]); atmVariables[atmid][rTextLabel] = CreateDynamic3DTextLabel(text,COLOR_GRAD1,atmVaria bles[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2],8.0); atmVariables[atmid][atmMoney] = 0; SendClientMessageEx(playerid, COLOR_WHITE, "Creaste satisfactoriamente el ATM indicado."); atmSave(); } else return SendClientMessageEx(playerid, COLOR_GREY, "USA: /crearatm [ID Libre]!"); return 1; } |
Es por que tienes la restricciуn de que si tu nivel de admin es diferente a 7 no te deje usar el cmd, osea funcionara unicamente si eres nivel 7, para eso cambiale el comparador '!=' a '<' asi el cmd dejara usar el cmd solo a los admin que tengan el nivel mayor a 6.
|
< 7
pawn Код:
|
CMD:crearatm(playerid, params[])
{
if(!IsPlayerConnectedEx(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, NoConectado);
if(Info[playerid][pAdmin] < 7)
{
new atmid;
if(!sscanf(params, "d", atmid))
{
if(atmid < 0 || atmid > MAX_ATMS) return SendClientMessageEx( playerid, COLOR_GREY, "* ID de ATM invбlida.");
if(atmVariables[atmid][atmMoney] > 0) return SendClientMessageEx( playerid, COLOR_GREY, "* Esta ID estб siendo utilizada.");
GetPlayerPos(playerid, atmVariables[atmid][fATMPos][0], atmVariables[atmid][fATMPos][1], atmVariables[atmid][fATMPos][2]);
GetPlayerFacingAngle(playerid, atmVariables[atmid][fATMPosRot]);
DestroyDynamicObject(atmVariables[atmid][rObjectId]);
atmVariables[atmid][rObjectId] = CreateDynamicObject(2942,atmVariables[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2]-0.4,0,0,atmVariables[atmid][fATMPosRot]);
new text[40];
format(text,sizeof(text),"%d\nIngresa tu tarjeta usando /atm.",atmid);
DestroyDynamic3DTextLabel(Text3D:atmVariables[atmid][rTextLabel]);
atmVariables[atmid][rTextLabel] = CreateDynamic3DTextLabel(text,COLOR_YELLOW,atmVariables[atmid][fATMPos][0],atmVariables[atmid][fATMPos][1],atmVariables[atmid][fATMPos][2],8.0);
atmVariables[atmid][atmMoney] = 0;
SendClientMessageEx(playerid, COLOR_WHITE, "Creaste satisfactoriamente el ATM indicado.");
atmSave();
}
else return SendClientMessageEx(playerid, COLOR_GREY, "USA: /crearatm [ID Libre]!");
}
else SendClientMessageEx(playerid, COLOR_GREY, "* No puedes usar este comando.");
return 1;
}
if(Info[playerid][pAdmin] >= 7)