admin spec - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: admin spec (
/showthread.php?tid=87968)
admin spec -
Geekzor - 23.07.2009
guys what is wrong wit adminspec at me ? i just compile it so i get Pwn and Amx files .... and i wire ''adminspec'' in to server.cfg file but when i command it dont work why now ? btw i am using a Ladmins cript too ... mybe u can find any problem here ??
here is my server cfg:
Код:
echo Executing Server Config...
lanmode 0
rcon_password *********
maxplayers 32
port 7777
hostname Test 1
gamemode0 RustlerFight
filterscripts adminspec vactions ladmin4v2 time advetising Weaps
announce 1
query 1
weburl www.sa-mp.com
anticheat 0
password *******
and here is admin spec :
Код:
//
// ADMIN SPECTATE FILTER SCRIPT
// kyeman 2007
//
#pragma tabsize 0
#include <a_samp>
#include <core>
#include <float>
#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];
//------------------------------------------------------------------------------------------------------
adminspec_strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
//------------------------------------------------------------------------------------------------------
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 = adminspec_strtok(cmdtext, idx);
// SPECTATE A PLAYER
if(strcmp(cmd, "/specplayer", true) == 0) {
new tmp[256];
tmp = adminspec_strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /specplayer [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 = adminspec_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;
}
//------------------------------------------------------------------------------------------------------
EDIT: uf sry i allmost forget in server when i type /specplayer it wont work it say SERVER:Unknown Command
any help pelase
ty
Re: admin spec -
Geekzor - 23.07.2009
o.O no help ?
Re: admin spec -
RyDeR` - 23.07.2009
Delete the old Adminspec and add the same FS one more time..
Re: admin spec -
Hiitch - 23.07.2009
in ladmin did you uncomment this line?
Код:
#define ENABLE_SPEC // Comment if you are using a spectate system already
if you are using a different spectate and dont want to use ladmins spec. do this
Код:
//#define ENABLE_SPEC // Comment if you are using a spectate system already
Re: admin spec -
Geekzor - 23.07.2009
guys ty for help but no luck ... it wont work ... is here any other way for spectating a player ?