[Pomoc]Oko ispisivanja teksta

Započeo Schwarz, Maj 06, 2013, 02:24:14 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) //will check if player is using Jetpack
    {
        if(JetPack[playerid] == 0) //if global variable JetPack is 0
        {
                new string[128],name[MAX_PLAYER_NAME];
                GetPlayerName(playerid,name,sizeof(name));
                format(string,sizeof(string),"LG: %s mozebi koristi Jetpack Hack proverete go.",name);
                SendClientMessageToAll(COLOR_GREEN,string);
        }
        else //if global variable JetPack is 1
        return 1; //will return 1;
    }
    else JetPack[playerid] = 0; //if player leaves the JetPack using Enter/F it will set the Global Variable JetPack to 0 again to avoid the problem in our command /jetpack

Detaljan opis problema:Kad igrac uzme jetpack ispisuje mi tekst svaku sekundu kako da uradim da mi ispisuje samo jednom ?
Dio skripte://
Neke slike/video za lakse dobivanje pomoci(neobavezno)://

Citat: Dzuna poslato Maj 06, 2013, 03:22:07 PRE PODNE
ETO OVAKO POKUSAJ  ;)
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) //will check if player is using Jetpack
    {
        if(JetPack[playerid] == 0) //if global variable JetPack is 0
        {
                new string[128];
        new name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                format(string, sizeof(string), "[AntiCheat]: %s (%d) koristi JetPack , proveri ga!", name, playerid);
        SendAdminMessage(COLOR_YELLOW, string);
        }
        else //if global variable JetPack is 1
        return 1; //will return 1;
    }
    else JetPack[playerid] = 0; //if player leaves the JetPack using Enter/F it will set the Global Variable JetPack to 0 again to avoid the problem in our command /jetpack
AKO ZATREBA JOS NESTO TU SAM  POZZ  :) :D
Ovo je ista stvar..
Samo  njegovom salje svim igraci a kopd tebe samo adminima


Dodaj na vrhu scripte

pporuku[MAX_PLAYERS];

OnPlayerConnect

pporuku[playerid] = 0;
SetTimerEx("ResetPoruku", 20000, true, "i", playerid);


napravi public

forward ResetPoruku(playerid);
public ResetPoruku(playerid)
{
pporuku[playerid] = 0;
return 1;
}


i sada zamenis voje za ovo

if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) //will check if player is using Jetpack
    {
        if(JetPack[playerid] == 0 && pporuku[playerid] == 0) //if global variable JetPack is 0
        {
                new string[128],name[MAX_PLAYER_NAME];
                GetPlayerName(playerid,name,sizeof(name));
                format(string,sizeof(string),"LG: %s mozebi koristi Jetpack Hack proverete go.",name);
                SendClientMessageToAll(COLOR_GREEN,string);
                pporuku[playerid] = 1;
        }
        else //if global variable JetPack is 1
        return 1; //will return 1;
    }
    else JetPack[playerid] = 0; //if player leaves the JetPack using Enter/F it will set the Global Variable JetPack to 0 again to avoid the problem in our command /jetpack

Znaci sada sam smanjio spam na svakih 20 sec..Ako oces samo 1 onda jednostavno ukloni timer

SetTimerEx("ResetPoruku", 20000, true, "i", playerid);