Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2012-08-26, 14:35


dadajszen







Wiek: 32
Na forum: 5303 dni
Posty: 59
Nick w MP: HooligaN

Piwa: 14

Respekt: 50

Witam,

Mam na moim serwerze Anty Rcona, to jest jakiej? osoby z PMS, chodzi o to, ?e on w og?le nie dzia?a, raz na jednym z serwerze dzia?a?, mam 20 slot?w na serwerze i mam przer?bk? PP oto ten kod:

Kod:

#include <a_samp>
#define CZERWONY 0xFF0000AA

#define SLOTY 20 //Zamiast 30 daj ilosc slotow

//Nicki W ""
#define NickRcon1 "[SSD]HooligaN[HA]"
#define NickRcon2 "[SSD]Maciek23_[Sz]"
new AdminRcon[30];
forward AdmR(playerid);
public OnPlayerConnect(playerid)
{
AdminRcon[playerid] = SetTimerEx("AdmR", 3000, 1, "d", playerid); // 3sek
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(AdminRcon[playerid]);
return 1;
}
public AdmR(playerid)
{
if(IsPlayerAdmin(playerid))
{
new name[32];
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(name,NickRcon1,true) || !strcmp(name,NickRcon2,true))
{
for(new i=0; i<GetMaxPlayers(); i++) /* P?tla */
{
if(IsPlayerConnected(i))
{
PlayerPlaySound(i, 1133, 0.0, 0.0, 0.0);
}
}
new str[128],Nick[24];
GetPlayerName(playerid,Nick,24);
format(str,128,"%s (ID:%d) Wita Graczy Serwera SSD",Nick,playerid);
SendClientMessageToAll(CZERWONY,str);
SetPlayerColor(playerid, CZERWONY);
KillTimer(AdminRcon[playerid]);
}
else
{
new str[128],Nick[24];
GetPlayerName(playerid,Nick,24);
format(str,128,"%s (ID:%d) zosta? wyrzucony pow?d: w?am na RCON'a",Nick,playerid);
SendClientMessageToAll(CZERWONY,str);
KillTimer(AdminRcon[playerid]);
Kick(playerid);
}
}
return 0;
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 18:31


Zbychu







Wiek: 29
Na forum: 5060 dni
Posty: 6



Respekt: 50

Nie wiem czy dzia?a, nie testowa?em. Jakby co?, pisz.

Kod:


#include <a_samp>
#define CZERWONY 0xFF0000AA

new timer;

forward Admin(playerid);

public OnPlayerConnect(playerid);
{
if(!strcmp(PlayerName(i),"[SSD]HooligaN[HA]",true) || !strcmp(PlayerName(i),"[SSD]Maciek23_[Sz]",true))
return timer = SetTimerEx("Admin", 3000, true, "i", playerid); //3 sek

return 1;
}

public Admin(playerid)
{
new str[128];

if(!IsPlayerAdmin(playerid))
return 1;

if(!strcmp(PlayerName(playerid),"[SSD]HooligaN[HA]",true) || !strcmp(PlayerName(playerid),"[SSD]Maciek23_[Sz]",true))
{
format(str,128,"%s (ID:%d) Wita Graczy Serwera SSD",Nick,playerid);
SendClientMessageToAll(CZERWONY,str);
SetPlayerColor(playerid, CZERWONY);
SoundForAll(1133);
KillTimer(timer);
}
else
{
format(str,128,"%s (ID:%d) zosta? wyrzucony pow?d: w?am na RCON'a",PlayerName(playerid),playerid);
SendClientMessageToAll(CZERWONY,str);
Kick(playerid);
}
return 1;
}

//D?? mapy/skryptu
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}

SoundForAll(sound)
{
for(new i = 0, j = GetMaxPlayers(); i < j; i ++)
if(IsPlayerConnected(i))
PlayerPlaySound(i,sound,0.0,0.0,0.0);
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-26, 20:50


Michalec

Dokładnie.






Wiek: 30
Na forum: 6405 dni
Posty: 163
Nick w MP: []Damianos[]

Piwa: 99

Respekt: 86,6

No brawo, brawo... Jest cos takiego jak OnRconLoginAttempt(...)

Oto kod odemnie:
Kod:

public OnRconLoginAttempt(ip[], password[], success)
{
if(success)
{
new playerid = GetPlayerIDFromIP(ip), name[32], str[128];
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(name,NickRcon1,true) || !strcmp(name,NickRcon2,true))
{
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
format(str,128,"%s (ID:%d) Wita Graczy Serwera SSD",name,playerid);
SendClientMessageToAll(CZERWONY,str);
SetPlayerColor(playerid, CZERWONY);
}else{
format(str,128,"%s (ID:%d) zosta? wyrzucony pow?d: w?am na RCON'a",name,playerid);
SendClientMessageToAll(CZERWONY,str);
Kick(playerid);
}
}
return 1;
}


Oraz funkcja:
Kod:

stock GetPlayerIDFromIP(ip[])
{
new
pIp[16]
;
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
GetPlayerIP(i, pIp, sizeof(pIp));

if(!strcmp(ip, pIp, true)) return i;
}
}
return INVALID_PLAYER_ID;
}


Pozdrawiam.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-27, 11:00


dadajszen







Wiek: 32
Na forum: 5303 dni
Posty: 59
Nick w MP: HooligaN

Piwa: 14

Respekt: 50

Michalec,


Kod:

D:\Pawn\Serwer PsP\Scrypty\Zabezpiecznie.pwn(51) : error 017: undefined symbol "GetPlayerIP"
D:\Pawn\Serwer PsP\Scrypty\Zabezpiecznie.pwn(51) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-27, 13:02


Combacior







Wiek: 29
Na forum: 5795 dni
Posty: 1516

Piwa: 2161

Respekt: 1060
Respekt: 1060

Ostrzeżeń: 20%
Kod:

stock GetPlayerIDFromIP(ip[])
{
new
pIp[16]
;
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
GetPlayerIp(i, pIp, sizeof(pIp));

if(!strcmp(ip, pIp, true)) return i;
}
}
return INVALID_PLAYER_ID;
}


Nie ma funkcji GetPlayerIP, tylko GetPlayerIp, wielko?? liter jest wa?na.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-08-27, 19:15


dadajszen







Wiek: 32
Na forum: 5303 dni
Posty: 59
Nick w MP: HooligaN

Piwa: 14

Respekt: 50

Wielkie dzi?ki, macie browca

Postaw piwo autorowi tego posta
 

 
Tagi: anty :: fake :: rcon
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [INNE] Anty Fake Rcon Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku