toll system wierd
#3

pawn Код:
enum tolldata { Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ }

#define TOTAL_TOLLS 2
new Tolls[TOTAL_TOLLS][tolldata] = {

    {1792.5, 663.29998779297, 16.89999961853, 9.4991760253906, 359.23846435547, 169.36804199219},
    {1768.9000244141, 669.0, 17.10000038147, 9.4976806640625, 359.23645019531, 169.365234375}
};

public OnFilterScriptInit()
{
    SetTimer("CheckPlayersNearToll", 1000, true);

    for(new toll = 0; toll < TOTAL_TOLLS; toll ++) {
        CreateDynamicObject(3578, Tolls[toll][X], Tolls[toll][Y], Tolls[toll][Z], Tolls[toll][rX], Tolls[toll][rY], Tolls[toll][rZ]);
    }
}

forward CheckPlayersNearToll();
public CheckPlayersNearToll() {

    for(new i = 0; i < MAX_PLAYERS; i ++) {
        if(!IsPlayerConnected(i)) continue;

        for(new toll = 0; toll < TOTAL_TOLLS; toll ++) {
       
            if(IsPlayerInRangeOfPoint(i, 5.0, Tolls[toll][X], Tolls[toll][Y], Tolls[toll][Z])) {
           
            //Do your code
            SetTimerEx("CloseToll", 5000, false, "i", toll);
            }
        }
    }
}

forward CloseToll(tollid);
public CloseToll(tollid) {

    //Close your toll gate here.
}
Have fun editting to your own preferences
Reply


Messages In This Thread
toll system wierd - by [LHT]Bally - 19.02.2012, 15:01
Re: toll system wierd - by aRoach - 19.02.2012, 15:02
Re: toll system wierd - by FuTuяe - 19.02.2012, 15:25
Re: toll system wierd - by [LHT]Bally - 19.02.2012, 15:27
Re: toll system wierd - by FuTuяe - 19.02.2012, 15:32
Re: toll system wierd - by [LHT]Bally - 19.02.2012, 15:34

Forum Jump:


Users browsing this thread: 2 Guest(s)