Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //***********| Admin Objects Coded By |********************//
- //*******************| By KmanN |************************//
- #include <a_samp>
- new ShipObject [MAX_PLAYERS], FlareObject [MAX_PLAYERS], SharkObject [MAX_PLAYERS], FogObject [MAX_PLAYERS], TurtleObject [MAX_PLAYERS], BushObject [MAX_PLAYERS];
- new ShipEnabled[MAX_PLAYERS], FlareEnabled[MAX_PLAYERS], SharkEnabled[MAX_PLAYERS], FogEnabled[MAX_PLAYERS], TurtleEnabled[MAX_PLAYERS], BushEnabled[MAX_PLAYERS];
- #pragma tabsize 0 // Removes loose indentation warnings
- public OnFilterScriptInit()
- {
- print( "\n--------------------------------------" );
- print( " Admin Object FS By KmanN ");
- print( "--------------------------------------\n" );
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect( playerid )
- {
- ShipEnabled [playerid] = false;
- FlareEnabled[playerid] = false;
- SharkEnabled[playerid] = false;
- FogEnabled[playerid] = false;
- TurtleEnabled[playerid] = false;
- BushEnabled[playerid] = false;
- return 1;
- }
- public OnPlayerDisconnect( playerid, reason )
- {
- if ( ShipEnabled[playerid] )
- DestroyObject( ShipObject[playerid] );
- if ( FlareEnabled[playerid] )
- DestroyObject( FlareObject[playerid] );
- if ( SharkEnabled[playerid] )
- DestroyObject( SharkObject[playerid] );
- if ( FogEnabled[playerid] )
- DestroyObject( FogObject[playerid] );
- if ( TurtleEnabled[playerid] )
- DestroyObject( TurtleObject[playerid] );
- if (BushEnabled[playerid] )
- DestroyObject( BushObject[playerid] );
- return 1;
- }
- public OnPlayerCommandText( playerid, cmdtext[] )
- {
- if ( !strcmp( "/ship", cmdtext, true, 7 ) )
- {
- if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 5) return 0;
- else
- if ( ShipEnabled[playerid] )
- {
- DestroyObject( ShipObject[playerid] );
- DestroyObject( FogObject[playerid] );
- SendClientMessage(playerid, 0xDEEE20FF, "The Ghost Ship is Disabled.");
- ShipEnabled[playerid] = false;
- FogEnabled[playerid] = false;
- return 1;
- }
- FogObject [playerid] = CreateObject( 2780, 0, 0, 0, 0, 0, 0 );
- FogEnabled[playerid] = true;
- ShipObject [playerid] = CreateObject( 8493, 0, 0, 0, 0, 0, 0 );
- ShipEnabled[playerid] = true;
- SendClientMessage(playerid, 0xDEEE20FF, "The Ghost Ship is Enabled.");
- AttachObjectToPlayer( ShipObject[playerid], playerid, 0, 0, 15, 0, 0, 0 );
- AttachObjectToPlayer( FogObject[playerid], playerid, 0, 2, 3, 0, 0, 0 );
- AttachObjectToPlayer( FogObject[playerid], playerid, 0, 10, 3, 0, 0, 0 );
- AttachObjectToPlayer( FogObject[playerid], playerid, 0, -2, 3, 0, 0, 0 );
- AttachObjectToPlayer( FogObject[playerid], playerid, 0, -10, 3, 0, 0, 0 );
- return 1;
- }
- if ( !strcmp( "/flare", cmdtext, true ) )
- {
- if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
- else
- if ( FlareEnabled[playerid] )
- {
- DestroyObject( FlareObject[playerid] );
- SendClientMessage(playerid, 0xDEEE20FF, "The Flare is Disabled.");
- FlareEnabled[playerid] = false;
- return 1;
- }
- FlareObject [playerid] = CreateObject( 354, 0, 0, 0, 0, 0, 0 );
- FlareEnabled[playerid] = true;
- SendClientMessage(playerid, 0xDEEE20FF, "The Flare is Enabled.");
- AttachObjectToPlayer( FlareObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
- return 1;
- }
- if ( !strcmp( "/shark", cmdtext, true ) )
- {
- if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
- else
- if ( SharkEnabled[playerid] )
- {
- DestroyObject( SharkObject[playerid] );
- SendClientMessage(playerid, 0xDEEE20FF, "The Shark is Disabled.");
- SharkEnabled[playerid] = false;
- return 1;
- }
- SharkObject [playerid] = CreateObject( 1608, 0, 0, 0, 0, 0, 0 );
- SharkEnabled[playerid] = true;
- SendClientMessage(playerid, 0xDEEE20FF, "The Shark is Enabled.");
- AttachObjectToPlayer( SharkObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
- return 1;
- }
- if ( !strcmp( "/fog", cmdtext, true ) )
- {
- if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
- else
- if ( FogEnabled[playerid] )
- {
- DestroyObject( FogObject[playerid] );
- SendClientMessage(playerid, 0xDEEE20FF, "The Fog is Disabled.");
- FogEnabled[playerid] = false;
- return 1;
- }
- FogObject [playerid] = CreateObject( 2780, 0, 0, 0, 0, 0, 0 );
- FogEnabled[playerid] = true;
- SendClientMessage(playerid, 0xDEEE20FF, "The Fog is Enabled.");
- AttachObjectToPlayer( FogObject[playerid], playerid, 0, 0, -3, 0, 0, 0 );
- return 1;
- }
- if ( !strcmp( "/turtle", cmdtext, true ) )
- {
- if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
- else
- if ( TurtleEnabled[playerid] )
- {
- DestroyObject( TurtleObject[playerid] );
- SendClientMessage(playerid, 0xDEEE20FF, "The Turtle is Disabled.");
- TurtleEnabled[playerid] = false;
- return 1;
- }
- TurtleObject [playerid] = CreateObject( 1609, 0, 0, 0, 0, 0, 0 );
- TurtleEnabled[playerid] = true;
- SendClientMessage(playerid, 0xDEEE20FF, "The Turtle is Enabled.");
- AttachObjectToPlayer( TurtleObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
- return 1;
- }
- if ( !strcmp( "/bush", cmdtext, true ) )
- {
- if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 0) return 0;
- else
- if ( BushEnabled[playerid] )
- {
- DestroyObject( BushObject[playerid] );
- SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Disabled.");
- BushEnabled[playerid] = false;
- return 1;
- }
- BushObject [playerid] = CreateObject( 800, 0, 0, 0, 0, 0, 0 );
- BushEnabled[playerid] = true;
- SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Enabled.");
- AttachObjectToPlayer( BushObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
- return 1;
- }
- if ( !strcmp( "/object", cmdtext, true ) )
- {
- if (!IsPlayerAdmin(playerid) && CallRemoteFunction("GetPlayerLevel","i",playerid) < 3) return 0;
- else
- {
- SendClientMessage(playerid, 0xFF0000, "---------------Object list------------.");
- SendClientMessage(playerid, 0xFF0000, " /ship For A Ship.");
- SendClientMessage(playerid, 0xFF0000, " /shark For A Shark Object.");
- SendClientMessage(playerid, 0xFF0000, " /flare For A Hydra Flare.");
- SendClientMessage(playerid, 0xFF0000, " /Fog For A Smoke Machine.");
- SendClientMessage(playerid, 0xFF0000, " /Turtle For A Turtle.");
- SendClientMessage(playerid, 0xFF0000, " /Bush For A Bush.");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- FogEnabled[playerid] = false;
- SharkEnabled[playerid] = false;
- FlareEnabled[playerid] = false;
- ShipEnabled[playerid] = false;
- TurtleEnabled[playerid] = false;
- BushEnabled[playerid] = false;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment