movedynamic object help
#1

how would i make it so i dont have to have multiple fs for these barrier's
Everytime i try put them together they fail

i also want to add these to it also
pawn Код:
toll2 = CreateDynamicObject(3578, 1808.3000488281, 904.29998779297, 8.8000001907349, 0, 0, 0);
 if(IsPlayerInRangeOfPoint(playerid, 5.0, 1805.3916, 895.3129, 9.6173))
                    {
                        MoveDynamicObject(toll2, 1808.3000488281, 904.29998779297, 5.3000001907349, 2.5);
                            SetPVarInt(playerid, "PVarMoney", -5);
                            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
                            SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
case 0: MoveDynamicObject(toll2, 1808.3000488281, 904.29998779297, 8.8000001907349, 2.5);
pawn Код:
#include <a_samp>
    #include <streamer>
    #include <foreach>
    #define red 0xFF0000AA

   new toll1;

    forward Tolls();
    forward Timer_TollsClose(tollid);

    public OnFilterScriptInit()
    {
         

      toll1 = CreateDynamicObject(3578, 1786.1999511719, 894.29998779297, 9.1999998092651, 0, 0, 0);
           
            SetTimer("Tolls", 1500, true);
            return 1;
    }




    public OnFilterScriptExit()
    {
            return 1;
    }

    public Tolls()
    {
            foreach(Player, playerid)
        {
                    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1787.7653, 906.1887, 9.2627))
                    {
                        MoveDynamicObject(toll1, 1786.1999511719, 894.29998779297, 7.4000000953674, 2.5);
                            SetPVarInt(playerid, "PVarMoney", -5);
                            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
                            SetTimerEx("Timer_TollsClose",5000,false,"i", 0);

                    }



     }
    }

    public Timer_TollsClose(tollid)
    {
        switch(tollid)
        {
            case 0: MoveDynamicObject(toll1, 1786.1999511719, 894.29998779297, 9.1999998092651, 2.5);

        }
    }
Reply
#2

??
Reply
#3

pawn Код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
new toll[2];
forward Tolls();
forward Timer_TollsClose(tollid);

public OnFilterScriptInit()
{
    toll[0] = CreateDynamicObject(3578, 1786.1999511719, 894.29998779297, 9.1999998092651, 0, 0, 0);
    toll[1] = CreateDynamicObject(3578, 1808.3000488281, 904.29998779297, 8.8000001907349, 0, 0, 0);
    SetTimer("Tolls", 1500, true);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public Tolls()
{
    foreach(Player, playerid)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 1787.7653, 906.1887, 9.2627))
        {
            MoveDynamicObject(toll[0], 1786.1999511719, 894.29998779297, 7.4000000953674, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 0)
        }
        else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1805.3916, 895.3129, 9.6173))
        {
            MoveDynamicObject(toll[1], 1808.3000488281, 904.29998779297, 5.3000001907349, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
        }
    }
}

public Timer_TollsClose(tollid)
{
    switch(tollid)
    {
        case 0: MoveDynamicObject(toll1, 1786.1999511719, 894.29998779297, 9.1999998092651, 2.5);
        case 1: MoveDynamicObject(toll2, 1808.3000488281, 904.29998779297, 8.8000001907349, 2.5);
    }
}
Hope work
Reply
#4

i got error

pawn Код:
error 001: expected token: ";", but found "}"
 error 017: undefined symbol "toll1"
 error 017: undefined symbol "toll2"
Reply
#5

pawn Код:
public Timer_TollsClose(tollid)
{
    switch(tollid)
    {
        case 0: MoveDynamicObject(toll[0], 1786.1999511719, 894.29998779297, 9.1999998092651, 2.5);
        case 1: MoveDynamicObject(toll[1], 1808.3000488281, 904.29998779297, 8.8000001907349, 2.5);
    }
}
MoveDynamicObject(toll1, 1808.3000488281, 904.29998779297, 8.8000001907349, 2.5);
MoveDynamicObject(toll[0], 1808.3000488281, 904.29998779297, 8.8000001907349, 2.5);
Reply
#6

The last 2 toll goes down but doesnt come up
im guessing ive done it wrong
This is the whole code
pawn Код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
new toll[4];

forward Tolls();
forward Timer_TollsClose(tollid);

public OnFilterScriptInit()
{
    toll[0] = CreateDynamicObject(3578, 1786.1999511719, 894.29998779297, 9.1999998092651, 0, 0, 0);
    toll[1] = CreateDynamicObject(3578, 1808.3000488281, 904.29998779297, 8.8000001907349, 0, 0, 0);
    toll[2] = CreateDynamicObject(3578, -739.70001220703, 692.20001220703, 17.5, 0, 0, 66.5);
    toll[3] = CreateDynamicObject(3578, -743.70001220703, 710.40002441406, 17.799999237061, 0, 0, 65);
    SetTimer("Tolls", 1500, true);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public Tolls()
{
    foreach(Player, playerid)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, 1787.7653, 906.1887, 9.2627))
        {
            MoveDynamicObject(toll[0], 1786.1999511719, 894.29998779297, 7.4000000953674, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
        }
        else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1805.3916, 895.3129, 9.6173))
        {
            MoveDynamicObject(toll[1], 1808.3000488281, 904.29998779297, 5.3000001907349, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
        }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, -739.70001220703, 692.20001220703, 17.5))
        {
            MoveDynamicObject(toll[2], -739.70001220703, 692.20001220703, 16, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
            }
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, -743.70001220703, 710.40002441406, 17.799999237061))
        {
            MoveDynamicObject(toll[3], 1-743.70001220703, 710.40002441406, 16.2000007629394, 2.5);
            SetPVarInt(playerid, "PVarMoney", -5);
            GameTextForPlayer(playerid, "~y~$10 Thankyou", 3000, 3);
            SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
            }
        }
       
}
public Timer_TollsClose(tollid)
{
    switch(tollid)
    {
        case 0: MoveDynamicObject(toll[0], 1786.1999511719, 894.29998779297, 9.1999998092651, 2.5);
        case 1: MoveDynamicObject(toll[1], 1808.3000488281, 904.29998779297, 8.8000001907349, 2.5);
        case 2: MoveDynamicObject(toll[2], -739.70001220703, 692.20001220703, 17.5, 2.5);
        case 3: MoveDynamicObject(toll[3], -743.70001220703, 710.40002441406, 17.799999237061, 2.5);
    }
}
Reply
#7

You have this

pawn Код:
SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
but should be

pawn Код:
SetTimerEx("Timer_TollsClose",5000,false,"i", 0);
SetTimerEx("Timer_TollsClose",5000,false,"i", 1);
SetTimerEx("Timer_TollsClose",5000,false,"i", 2);
SetTimerEx("Timer_TollsClose",5000,false,"i", 3);
Reply
#8

thanks will test it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)