only moving for player with id 0
#1

how to make this work for all id not just player 0

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) == 253 || GetPlayerSkin(playerid) == 255)
        {
            MoveDynamicObject(bus, 1961.6999511719, -2189.8000488281, 11.5, 2.5);
            SetTimerEx("Close",7000,false,"i", 0);
            }
            else
            {
            SendClientMessage(playerid,Message_color,"you are not a bus or taxi driver");
            }
        }
}

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

Instead of:

pawn Код:
SetTimer("Tolls", 1500, true);
use:

pawn Код:
SetTimerEx("Tolls", 1500, true, "d", playerid);
But OnPlayerConnect(playerid)
Reply
#3

SetTimerEx("Tolls", 1500, true, "d", playerid);
Reply
#4

pawn Код:
forward Tolls();

public Tolls()
{
    for ( new i = 0; i != MAX_PLAYERS; ++i )
    {
        if ( IsPlayerInRangeOfPoint( i, 10.0, 1961.6999511719, -2190, 13.10000038147 ) )
        {
            if ( GetPlayerSkin( i ) == 253 || GetPlayerSkin( i ) == 255 )
            {
                MoveDynamicObject( bus, 1961.6999511719, -2189.8000488281, 11.5, 2.5 );
                SetTimerEx( "Close", 7000, false, "i", 0 );
            } else {
                SendClientMessage( i, Message_color, "you are not a bus or taxi driver" );
            }
        }
    }
}
Reply
#5

so like this ?

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);
   
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect( playerid )
{
SetTimerEx("Tolls", 1500, true, "d", playerid);
return 1;
}
public Tolls(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1961.6999511719, -2190, 13.10000038147))
    {
        if(GetPlayerSkin(playerid) == 253 || GetPlayerSkin(playerid) == 255)
        {
            MoveDynamicObject(bus, 1961.6999511719, -2189.8000488281, 11.5, 2.5);
            SetTimerEx("Close",7000,false,"i", 0);
            }
            else
            {
            SendClientMessage(playerid,Message_color,"you are not a bus or taxi driver");
            }
        }
}

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

Quote:
Originally Posted by [LHT]Bally
Посмотреть сообщение
so like this ?

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);
   
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect( playerid )
{
SetTimerEx("Tolls", 1500, true, "d", playerid);
return 1;
}
public Tolls(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 10.0, 1961.6999511719, -2190, 13.10000038147))
    {
        if(GetPlayerSkin(playerid) == 253 || GetPlayerSkin(playerid) == 255)
        {
            MoveDynamicObject(bus, 1961.6999511719, -2189.8000488281, 11.5, 2.5);
            SetTimerEx("Close",7000,false,"i", 0);
            }
            else
            {
            SendClientMessage(playerid,Message_color,"you are not a bus or taxi driver");
            }
        }
}

public Close()
{
    MoveDynamicObject(bus, 1961.6999511719, -2190, 13.10000038147, 3.5);
    return 1;
}
Yes, that should work fine. If it doesn't (which I doubt), use T0pAz's version.
Reply
#7

Quote:
Originally Posted by SpiritEvil
Посмотреть сообщение
Yes, that should work fine. If it doesn't (which I doubt), use T0pAz's version.
thanks +rep
Reply
#8

Quote:
Originally Posted by [LHT]Bally
Посмотреть сообщение
thanks +rep
You're welcome, and thanks for the rep
Reply
#9

Quote:
Originally Posted by supmygirl
Посмотреть сообщение
kjhghjgjg
Reported for spamming.
Reply
#10

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Reported for spamming.
Same
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)