[POMOC] Filterskripte & include fajlovi

Započeo ÄŒiter, Jun 13, 2011, 20:43:07 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Ovako imam server a treba mi hitno komadna /recon tj komanda da pratim igraca ko moze dati link da je skinem
UNAPRIJED MU HVALA!

Spike

Evo ti


//
//  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;
}

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


Citat: Spike poslato Jun 13, 2011, 20:44:21 POSLE PODNE
Evo ti


//
//  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;
}

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



Sry brate novi sam neznam baratati sa ovim xD kako da ovo ubacim
Ako mi mozes objasniti Hvala ti unaprijed!

vlado_plavsic

Evo ja cu:

1.Odes u pawno i kliknes na new

2.na vrh skripte stavis

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


3.Ispod toga stavis
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFFF

(Posle ovoga mozes a i ne moras da stavis //------------------------------------------------------------------------------------------------------// )

4.ispod crte stavis
#define ADMIN_SPEC_TYPE_NONE 0
#define ADMIN_SPEC_TYPE_PLAYER 1
#define ADMIN_SPEC_TYPE_VEHICLE 2


5.Ispod stavis
new gSpectateID[MAX_PLAYERS];
new gSpectateType[MAX_PLAYERS];


6.Ispod toga odvojis o5 sa //------------------------------------------------------------------------------------------------------// i stavis

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;
}

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

7.posle toga stisnes ctrl + f i copy tamo OnFilterScriptInit()

8.ispod OnFilterScriptInit() stavis sledece
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;
}

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


To bi trebalo da je to,ako nece obrati mi se na PM ...pozz
Poslednja Izmena: Jun 13, 2011, 22:40:34 POSLE PODNE od Vlado_Plavsic

KAd otvorim NEW nije mi prazno ima nesto i sad odma na pocetku gore stavljam ovo ovako moram sve pobrisati

Spike

Evo ti lakse:

1. Otvoris pawno program
2. Kopiras ovo sto sam ja napiso i zaljepis tu
3. Odes file gore i save as,odaberes mjesto gdje ces spremit i namjestis ovo dole ( naziv datoteke: naziv.pwn  u obliku: PAWN Scripts )
4. Onda ponovo ubacis taj spec.pwn u pawnu i ides compile,stvorit ce ti se spec.amx
5. Odes u mapu gdje ti je ovo za kucni server,ubacis .pwn i .amx u filterscripts
6. Odes pod server ( CFG datoteka ) i to otvoris sa blok za pisanje
7. Nades red gdje ti pise filterscripts u taj red dodas samo ''spec'' ili kako si vec stavio ime u 3 koraku :D

To ti je to

Napravio sam sad kad ja njega /recon kasnije nez kako da ugasim pracenje jednio da ga kick  :D :D
Kako da ugasim npr: pratio ga i nema nista kako ugasiti recon.. u mene je /specplayer [ID]

Hvala Vam Svima!  :-*

Mozete LOCK!
Poslednja Izmena: Jun 14, 2011, 11:20:40 PRE PODNE od ÄŒiter