#include < a_samp >public OnFilterScriptInit( ){ SetTimer( \"Update\", 3000, true );}public OnPlayerConnect( playerid ){ SetPVarInt( playerid, \"Flood\", 0 ); return 1;}public OnPlayerText( playerid, text[] ){ SetPVarInt( playerid, \"Flood\", GetPVarInt( playerid, \"Flood\" ) + 1 ); if( GetPVarInt( playerid, \"Flood\" ) > 1 ) { SendClientMessage( playerid, 0xFF0000AA, \"HIBA: 3 Másodpercenként küldhetsz üzenetet, Írj lassabban!\" ); } return 0;}forward Update( playerid );public Update( playerid ){ foreach(Player, i) { if( GetPVarInt( i, \"Flood\" ) > 0 ) { SetPVarInt( i, \"Flood\", 0 ); } }}
C:\\Documents and Settings\\Robi\\Asztal\\Új mappa (4)\\new.pwn(28) : error 017: undefined symbol \"foreach\"C:\\Documents and Settings\\Robi\\Asztal\\Új mappa (4)\\new.pwn(30) : error 017: undefined symbol \"i\"C:\\Documents and Settings\\Robi\\Asztal\\Új mappa (4)\\new.pwn(32) : error 017: undefined symbol \"i\"Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 3 Errors.
#include < a_samp >#include < foreach >public OnFilterScriptInit( ){ SetTimer( \"Update\", 3000, true );}public OnPlayerConnect( playerid ){ SetPVarInt( playerid, \"Flood\", 0 ); return 1;}public OnPlayerText( playerid, text[] ){ SetPVarInt( playerid, \"Flood\", GetPVarInt( playerid, \"Flood\" ) + 1 ); if( GetPVarInt( playerid, \"Flood\" ) > 1 ) { SendClientMessage( playerid, 0xFF0000AA, \"HIBA: 3 Másodpercenként küldhetsz üzenetet, Írj lassabban!\" ); } return 0;}forward Update( playerid );public Update( playerid ){ foreach(Player, i) { if( GetPVarInt( i, \"Flood\" ) > 0 ) { SetPVarInt( i, \"Flood\", 0 ); } }}
#include <a_samp>static iPlayerChatTime[MAX_PLAYERS];stock IsPlayerFlooding(playerid){if(GetTickCount() - iPlayerChatTime[playerid] < 2000) return 1;return 0;}public OnPlayerText(playerid, text[]){// Is the player flooding?if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid)){ SendClientMessage(playerid, 0xFF0000FF, \"* You can only send a message once every two seconds.\"); return 0;}iPlayerChatTime[playerid] = GetTickCount();// bla bla.. return 1;}public OnPlayerDisconnect(playerid, reason){iPlayerChatTime[playerid] = 0;return 1;}public OnPlayerCommandText(playerid, cmdtext[]){if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid)){SendClientMessage(playerid, 0xFF0000FF, \"* You can only use commands once every two seconds.\"); return 1;}iPlayerChatTime[playerid] = GetTickCount();// command ..... return 0;}
baseaf.inc #include <a_samp> static iPlayerChatTime[MAX_PLAYERS]; stock IsPlayerFlooding(playerid) { if(GetTickCount() - iPlayerChatTime[playerid] < 2000) return 1; return 0; } public OnPlayerText(playerid, text[]) { // Is the player flooding? if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid, 0xFF0000FF, \"* You can only send a message once every two seconds.\"); return 0; } iPlayerChatTime[playerid] = GetTickCount(); // bla bla.. return 1; } public OnPlayerDisconnect(playerid, reason) { iPlayerChatTime[playerid] = 0; return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid, 0xFF0000FF, \"* You can only use commands once every two seconds.\"); return 1; } iPlayerChatTime[playerid] = GetTickCount(); // command ..... return 0; } Legelsõ filterszkript-be -ként kell beleírni\\betenni.server.cfgfilterscripts baseaf (többi szkript neve)[/quote]Kösz, mûködik !
#include <a_samp> static iPlayerChatTime[MAX_PLAYERS]; stock IsPlayerFlooding(playerid) { if(GetTickCount() - iPlayerChatTime[playerid] < 2000) return 1; return 0; } public OnPlayerText(playerid, text[]) { // Is the player flooding? if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid, 0xFF0000FF, \"* You can only send a message once every two seconds.\"); return 0; } iPlayerChatTime[playerid] = GetTickCount(); // bla bla.. return 1; } public OnPlayerDisconnect(playerid, reason) { iPlayerChatTime[playerid] = 0; return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid)) { SendClientMessage(playerid, 0xFF0000FF, \"* You can only use commands once every two seconds.\"); return 1; } iPlayerChatTime[playerid] = GetTickCount(); // command ..... return 0; }