how to make something move for certain skin ids
#1

how can i make a barier system work for only 2 skin ids so say skin 7 and skin 6
Reply
#2

pawn Код:
new datskin
datskin = GetPlayerSkin(playerid);
if(datskin == 7 || datskin == 6)
{
  do shit here
  return 1;
}
Reply
#3

thats easy
Is it a command you have to make the barrier move?
Reply
#4

no code is here
pawn Код:
#include <a_samp>
    #include <streamer>
    #include <foreach>
    #define red 0xFF0000AA

    new bus;

    forward Tolls();
    forward Timer_TollsClose(tollid);

    public OnFilterScriptInit()
    {
            print("\n--------------------------------------");
            print("bus barriier");
            print("--------------------------------------\n");

        bus = CreateDynamicObject(3578, 1961.6999511719, -2190, 13.10000038147, 0, 0, 179);
           
            SetTimer("Tolls", 1500, true);
            return 1;
    }



    public OnFilterScriptExit()
    {
            return 1;
    }

    public Tolls()
    {
            foreach(Player, playerid)
        {
                    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1961.6999511719, -2190, 13.10000038147))
                    {
                        MoveDynamicObject(bus, 1961.6999511719, -2189.8000488281, 11.5, 2.5);
                           
                            SetTimerEx("Timer_TollsClose",7000,false,"i", 0);

                    }



     }
    }

    public Timer_TollsClose(tollid)
    {
        switch(tollid)
        {
            case 0: MoveDynamicObject(bus, 1961.6999511719, -2190, 13.10000038147, 3.5);

        }
    }
Reply
#5

but when the barrier goes down it spins :S i think its because im using createdynamicobject
Reply
#6

with that thing above it gives errors using datskin thing
Reply
#7

Im going to write it so it works.
Reply
#8

hey i havn't tested this here you go.

pawn Код:
#include <a_samp>
#include <streamer>
#include <foreach>
#define red 0xFF0000AA
#define Message_color 0xFF0000AA
new bus;
forward Tolls(playerid);
forward Close();
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("bus barriier");
    print("--------------------------------------\n");
    bus = CreateDynamicObject(3578, 1961.6999511719, -2190, 13.10000038147, 0, 0, 179);
    SetTimer("Tolls", 1500, true);
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}

public Tolls(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1961.6999511719, -2190, 13.10000038147))
    {
        if(GetPlayerSkin(playerid) == 7 || GetPlayerSkin(playerid) == 8)
        {
            MoveDynamicObject(bus, 1961.6999511719, -2189.8000488281, 11.5, 2.5);
            SetTimerEx("Close",7000,false,"i", 0);
            }
            else
            {
            SendClientMessage(playerid,Message_color,"you don't have person to open this");
            }
        }
}

public Close()
{
    MoveDynamicObject(bus, 1961.6999511719, -2190, 13.10000038147, 3.5);
    return 1;
}
Reply
#9

Also, try using OnPlayerUpdate instead of a timer as it will make the script run faster

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1961.6999511719, -2190, 13.10000038147))
    {
        if(GetPlayerSkin(playerid) == 7 || GetPlayerSkin(playerid) == 8)
        {
            MoveDynamicObject(bus, 1961.6999511719, -2189.8000488281, 11.5, 2.5);
            SetTimerEx("Close",7000,false,"i", 0);
        }
        else
        {
            SendClientMessage(playerid,Message_color,"you don't have person to open this");
        }
    }
    return 1;
}
Reply
#10

Quote:
Originally Posted by [LHT]Bally
Посмотреть сообщение
with that thing above it gives errors using datskin thing
I assumed you already had your code for the barrier. That's just the if statement you need.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)