[FilterScript] Spec System
#1

Yo.

Cheers everyone , i hope u all be okay , the reason that im here today is that i've made a new FS , which is Spec System , and that took me about 1-2 hours to make it , using this system u can spec online players , u can also spec them if they are in cars , and thats nothing complicated just a simple system. btw i hope u like it

OK , here is the code :
Код:
//
//  ADMIN SPEC FILTERSCRIPT
By Stream 
//

#pragma tabsize 0
#include <a_samp>
#include <core>
#include <float>

#include "../include/gl_common.inc"

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFFF

//------------------------------------------------------------------------------------------------------

#define ADMIN_SPEC_TYPE_NONE 0
#define ADMIN_SPEC_TYPE_PLAYER 1
#define ADMIN_SPEC_TYPE_VEHICLE 2

new gSpectateID[MAX_PLAYERS];
new gSpectateType[MAX_PLAYERS];

//------------------------------------------------------------------------------------------------------

public OnFilterScriptInit()
{
}

//------------------------------------------------------------------------------------------------------

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	// IF ANYONE IS SPECTATING THIS PLAYER, WE'LL ALSO HAVE
	// TO CHANGE THEIR INTERIOR ID TO MATCH
	new x = 0;
	while(x!=MAX_PLAYERS) {
	    if( IsPlayerConnected(x) &&	GetPlayerState(x) == PLAYER_STATE_SPECTATING &&
			gSpectateID[x] == playerid && gSpectateType[x] == ADMIN_SPEC_TYPE_PLAYER )
   		{
   		    SetPlayerInterior(x,newinteriorid);
		}
		x++;
	}
}

//------------------------------------------------------------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256];
	new specplayerid, specvehicleid, idx;

	// WE ONLY DEAL WITH COMMANDS FROM ADMINS IN THIS FILTERSCRIPT
	if(!IsPlayerAdmin(playerid)) return 0;

	cmd = strtok(cmdtext, idx);

	// SPECTATE A PLAYER
 	if(strcmp(cmd, "/spec", true) == 0) {
	    new tmp[256];
		tmp = strtok(cmdtext, idx);

		if(!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec [playerid]");
			return 1;
		}
		specplayerid = strval(tmp);
		
		if(!IsPlayerConnected(specplayerid)) {
		    SendClientMessage(playerid, COLOR_RED, "specplayer: that player isn't active.");
			return 1;
		}
		
		TogglePlayerSpectating(playerid, 1);
		PlayerSpectatePlayer(playerid, specplayerid);
		SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
		gSpectateID[playerid] = specplayerid;
		gSpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
		
 		return 1;
	}

	// SPECTATE A VEHICLE
 	if(strcmp(cmd, "/specvehicle", true) == 0) {
	    new tmp[256];
		tmp = strtok(cmdtext, idx);

		if(!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specvehicle [vehicleid]");
			return 1;
		}
		specvehicleid = strval(tmp);
		
		if(specvehicleid < MAX_VEHICLES) {
			TogglePlayerSpectating(playerid, 1);
			PlayerSpectateVehicle(playerid, specvehicleid);
			gSpectateID[playerid] = specvehicleid;
			gSpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
		}
 		return 1;
	}

	// STOP SPECTATING
 	if(strcmp(cmd, "/specoff", true) == 0) {
		TogglePlayerSpectating(playerid, 0);
		gSpectateID[playerid] = INVALID_PLAYER_ID;
		gSpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
		return 1;
	}

	return 0;
}

 EDITED ://///////////////all of the credits doesnt belong to me/////////////////
I hope u like . PS : plz leave your idea about it after u saw the post.

NOTE : as some of u may know , this was a edited version of one of the sa-mp's default FS's , i just edited it , and that really took me at least about 30mins.

Regards.
Reply
#2

Good job. But next time use ZCMD or YCMD. Try something like spectate area or something...
Reply
#3

Really?
Copy & Paste from the default filterscript "adminspec.pwn" -_-
You never done anything except removed the credits by kyle
Reply
#4

Quote:
Originally Posted by Stream
Посмотреть сообщение
and that took me about 1-2 hours to make it
You must have some type of disease if it took you that long to copy paste that.
Reply
#5

Quote:
Originally Posted by [Hunter]
Посмотреть сообщение
You must have some type of disease if it took you that long to copy paste that.
You make me lul Repped
Reply
#6

Well done. If it is a result of your hard work.

Note - Nice work.

#March
Reply
#7

Good job!
Reply
#8

Anyone can obtain this filterscript from filterscripts folder within the server package, I believe the only part that you've edited, changed or removed was the credits..

pawn Код:
//
//  ADMIN SPECTATE FILTER SCRIPT
//  kye 2007
//
So put the original credits back please.. because no part of this script was created by you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)