How would I set this as a admin Command
#1

How do I edit this so only a level 10 admin can use it.
I know the script is only for Rcon Admins But I dont want to have to log in to it all the time cause it kicks me ( bugged)




/*
!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!! !!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!! !!!!!!!! !!!!!!!
!!!!!!!!!!!!!! !!!!!!!!!!!!!! !!!!!!!!! !!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!!!!! !!!!!!!!
!!!!!!! !!!!!!! !!!!!!!!!!!!!!! !!!!!!! !!!!!!! !!!!!!! !!!!!! !!!!!!! !!!!!!! !!!!!!!!!!!!!!! !!!!!!!
!!!!!!! !!!!!! !!!!!!! !!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! !!!!!!! !!!!!!! !!!!!!! !!!!!!! !!!!!!!
!!!!!!! !!!!!!! !!!!!! !!!!!!! !!!!!!!!!! !!!!!!!!!!!!!!!!!!! !!!!!!! !!!!!!! !!!!!! !!!!!!!! !!!!!!!
!!!!!!! !!!!!!!!!!!!!! !!!!!!! !!!!!!! ! !!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! !!!!!!!!!!!!!!!!
!!!!!!! !!!!!!!!!!!! !!!!!!! !!!!!!! !!!!!!!!! !!!!!!! !!!!!!!! !!!!! !!!!!!! !!!!!!!! !!!!!!!!!!!!!!
!!!!!!! !!!!!!!!! !!!!!!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! !!!!!!!! !!!!!!!! !!!!!!!!!!!
*/
#include <a_samp>
#define FILTERSCRIPT


#define MAX_GAMERS 200 //analog for maxplayers

//______________________________[SETTINGS]______________________________________

//#define ONLYFORADMINS //unmark this if you want using this script only for rcon admin

#define UPFLY -0.008 //force fly (this top)

#define SPEED 15.0 //flying speed

//__________________________________________________ ____________________________

forward Float:MOVEVEHICLE(playerid, &Float:q, &Float:w, Float:distance);
forward START();
new Float, Float:y, Float:z;
new bool:FLYMODE[MAX_GAMERS];
new SEXYTIMER;
new K, U, L;
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" [FS] Fly System (LOADED)");
print(" Author: MYSAN");
print("--------------------------------------\n");
SEXYTIMER = SetTimer("START",100,1);
return 1;
}

public OnFilterScriptExit()
{
print(" [FS] Fly System by MYSAN (UNLOADED)");
KillTimer(SEXYTIMER);
SetGravity(0.00;
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" [FS] Fly System");
print(" Author: MYSAN");
print("----------------------------------\n");
}

#endif

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
FLYMODE[playerid] = false;
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
//FLYMODE[playerid] = false;
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
//FLYMODE[playerid] = false;
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerPrivmsg(playerid, recieverid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/FLYON", cmdtext, true, 10) == 0)
{
#if defined ONLYFORADMINS
if(IsPlayerAdmin(playerid))
{
#endif
FLYMODE[playerid] = true;
SendClientMessage(playerid,0x5BC476FF,"Now you can fly ! (Use keys PgUP and PgDown)");
#if defined ONLYFORADMINS
} else return SendClientMessage(playerid,0xFF0000AA," You not RCON admin !");
#endif
return 1;
}
if (strcmp("/FLYOFF", cmdtext, true, 10) == 0)
{
#if defined ONLYFORADMINS
if(IsPlayerAdmin(playerid))
{
#endif
FLYMODE[playerid] = false;
SendClientMessage(playerid,0xFF0000AA,"Now you can't fly !");
#if defined ONLYFORADMINS
} else return SendClientMessage(playerid,0xFF0000AA," You not RCON admin !");
#endif
return 1;
}
return 0;
}

public OnPlayerInfoChange(playerid)
{
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
SetPlayerGravity(playerid, 0.00;
//FLYMODE[playerid] = false;
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public START()
{
for(new playerid=0;playerid<MAX_PLAYERS;playerid++)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(FLYMODE[playerid] == true)
{
if(IsPlayerConnected(playerid))
{
GetPlayerKeys(playerid,K,U,L);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(K == KEY_ANALOG_UP)
{
GetVehiclePos(vehicleid, x, y, z);
MOVEVEHICLE(playerid, x, y, SPEED);
SetVehiclePos(vehicleid, x, y, z);
SetCameraBehindPlayer(playerid);
}
if(K == KEY_ANALOG_DOWN)
{
SetPlayerGravity(playerid, UPFLY);
}
else
{
SetPlayerGravity(playerid, 0.00;
}
}
}
}
}
return 1;
}
stock SetPlayerGravity(playerid,Float:gravity) {
for (new porno = playerid; porno <MAX_PLAYERS; porno++)
{
if(IsPlayerConnected(porno))
{
playerid = SetGravity(Float:gravity);
}
}
}
Float:MOVEVEHICLE(playerid, &Float:q, &Float:w, Float:distance)
{
new Float:a;
GetVehiclePos(playerid, q, w, a);
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
else GetPlayerFacingAngle(playerid, a);
q += (distance * floatsin(-a, degrees));
w += (distance * floatcos(-a, degrees));
return a;
}
Reply


Messages In This Thread
How would I set this as a admin Command - by nathana556 - 13.08.2014, 04:04
Re: How would I set this as a admin Command - by GGW - 13.08.2014, 04:11
Re: How would I set this as a admin Command - by AzaMx - 13.08.2014, 08:14
Re: How would I set this as a admin Command - by Blademaster680 - 13.08.2014, 11:07

Forum Jump:


Users browsing this thread: 2 Guest(s)