23.01.2012, 00:36
Bueno les agradeceria si me pasan un sistema con un cmd que sea para cuando un admin esta duty, y por ej el cmd sea /volar y asi el admin solamente cuando este duty pueda volar alguien lo tiene?
if(strcmp(cmd, "/volar", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(ConFly[playerid] == 1) { ConFly[playerid] = 0; SendClientMessage(playerid, COLOR_GRAD1, " Vuelo DesActivado."); }
if(ConFly[playerid] == 0) { ConFly[playerid] = 1; SendClientMessage(playerid, COLOR_GRAD1, " Vuelo Activado."); }
return 1;
}
if (PlayerInfo[playerid][pAdmin] <= 1)
{
SendClientMessage(playerid, COLOR_GRAD1, " No eres un admin !");
return 1;
}
return 1;
}
//Al tope
new ConFly[MAX_PLAYERS];
#include <a_samp>
#include <fly>
new Fly[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Fly[playerid]=0;
InitFly(playerid);
}
public OnPlayerDisconnect(playerid,reason)
{
Fly[playerid]=0;
InitFly(playerid);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/volar", cmdtext, true, 10) == 0)
{
if(Fly[playerid]==0)
{
SendClientMessage(playerid,-1,"Estas volando");
StartFly(playerid);
Fly[playerid]=1;
}
else
{
SendClientMessage(playerid,-1,"Paraste de volar");
StopFly(playerid);
Fly[playerid]=0;
}
return 1;
}
return 0;
}

if(strcmp(cmd, "/superman", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(ConFly[playerid] == 1) { ConFly[playerid] = 0; SendClientMessage(playerid, COLOR_LIGHTRED, " Vuelo DesActivado."); }
else if(ConFly[playerid] == 0) { ConFly[playerid] = 1; SendClientMessage(playerid, COLOR_LIGHTRED, " Vuelo Activado. Debes Saltar para volar. Usa /Superman Nuevamente para desactivar."); }
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, " No eres un administrador!");
}
}
return 1;
}
new ConFly[MAX_PLAYERS];
ConFly[playerid] = 0;
if(ConFly[playerid] == 1)
{
new Keys,AB,ID;
GetPlayerKeys(playerid,Keys,AB,ID);
if(Keys == KEY_JUMP)
{
if(IsPlayerInAnyVehicle(playerid)) return 1;
new Float: X, Float: Y, Float: Z, Float: ROT;
GetPlayerVelocity(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, ROT);
X += floatmul(floatsin(-ROT, degrees), 0.12); //Modifica 0.12 para cambiar el largo del salto
Y += floatmul(floatcos(-ROT, degrees), 0.12); //Aca tambiйn
SetPlayerVelocity(playerid, X, Y, Z+0.3); //Modifica 0.1 para cambiar la altura del salto
}
}
yo dure como suиrman 1 semana jajaja