Need help with my filterscript
#1

i have just been programming a filterscript of mine but now something is broken.
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
new drivers[20];
forward starttimer();

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    new countfor;
    new id;
    print("\n--------------------------------------");
    print(" Demolition Derby for --- by kazai");
    print("--------------------------------------\n")
    id = 0;
    for(countfor = 0; countfor < 21; countfor++) {
        drivers[id] = -1;
        id++;
    }
    SetTimer("starttimer",180000,false);
    print("DONE");
    return 1;
}
thats the script basically, yet for some reason it never gets past the for loop anymore. it is necessary that it passes it to activate the timer. can anyone explain what is wrong and how to fix it? the reason i ask is cos it posts no error messages on compile
Reply
#2

You went a bit wrong with your loop. You defined loads of variables to increase with the loop, but that's unnecessary. Try this:

pawn Код:
#include <a_samp>

new drivers[20];
forward starttimer();

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Demolition Derby for --- by kazai");
    print("--------------------------------------\n");

    for(new id; id < 21; id++)
    {
        drivers[id] = -1;
    }
    SetTimer("starttimer",180000,false);
    print("DONE");
    return 1;
}

public starttimer()
{
    //blah blah
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)