Gang Cars Problem
#1

PROBLEM SOLVED!!! Thanks to ghost556 ! He is +REPPED.
Reply
#2

You returned the timer after the 'if' statement.
No further code will be executed,like that message.
Also you should could use SetTimerEx,as you got playerid
So you can put it like this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == BallasCar1 || BallasCar2 || BallasCar3 || BallasCar4 || BallasCar5 || BallasCar6)
    {
        if(PlayerInfo[playerid] [pBallas] < 1)
        {
            SendClientMessage(playerid,COLOR_PINK, "Ballas Car");
                SetTimerEx("BallasRFV",2000,false,"i", playerid);//In two seconds after entering the car(pressing F/ENTER),BallasRFW(playerid); will be called
        }
    }
    return 1;
}
forward BallasRFV(playerid);   //Ballas Remove Player From Vehicle
public BallasRFV(playerid)
{
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_PINK,"You cannot drive Ballas Cars!");
    return 1;
}
Reply
#3

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == BallasCar1 || BallasCar2 || BallasCar3 || BallasCar4 || BallasCar5 || BallasCar6)
    {
        if(PlayerInfo[playerid] [pBallas] < 1) 
        {
                ClearAnimations(playerid);
        	SendClientMessage(playerid,COLOR_PINK, "Ballas Car");
        }
        return 1;
	}
    return 1;
}
Try using that then the Personal RFV and let me know if that made it work
Reply
#4

Quote:
Originally Posted by Tagathron
Посмотреть сообщение
You returned the timer after the 'if' statement.
No further code will be executed,like that message.
Also you should could use SetTimerEx,as you got playerid
So you can put it like this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == BallasCar1 || BallasCar2 || BallasCar3 || BallasCar4 || BallasCar5 || BallasCar6)
    {
        if(PlayerInfo[playerid] [pBallas] < 1)
        {
            SendClientMessage(playerid,COLOR_PINK, "Ballas Car");
                SetTimerEx("BallasRFV",2000,false,"i", playerid);//In two seconds after entering the car(pressing F/ENTER),BallasRFW(playerid); will be called
        }
    }
    return 1;
}
forward BallasRFV(playerid);   //Ballas Remove Player From Vehicle
public BallasRFV(playerid)
{
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,COLOR_PINK,"You cannot drive Ballas Cars!");
    return 1;
}
It doesn't work... Its baddest than mine...
Reply
#5

Nothing of these work
Reply
#6

Quote:
Originally Posted by dakata994
Посмотреть сообщение
Nothing of these work
Alright can you see if you can show the code that adds the vehicles into the script so
Код:
BallasCar1 = AddStaticVehicle ((Or how ever you added it into it))
Reply
#7

Код:
	BallasCar1 = CreateVehicle(566, 2001.8361, -1143.2703, 25.3445, 89.0000, -1, -1, 100);
	BallasCar2 = CreateVehicle(566, 1992.5623, -1128.3490, 25.6445, 89.0000, -1, -1, 100);
	BallasCar3 = CreateVehicle(517, 2004.4861, -1120.9596, 26.5874, 179.0000, -1, -1, 100);
	BallasCar4 = CreateVehicle(517, 2013.1475, -1121.1638, 26.5874, 179.0000, -1, -1, 100);
	BallasCar5 = CreateVehicle(482, 1992.9958, -1119.0502, 26.8656, -90.0000, -1, -1, 100);
	BallasCar6 = CreateVehicle(567, 2018.8954, -1128.4579, 25.1946, 89.0000, -1, -1, 100);
Here you are
Reply
#8

Just try doing it the way i did it for my roleplay server, obviously you will need to change a few things but just quote your ones

// Top of script
Код:
new BallasCar[6];
// Vehicles
Код:
        BallasCar[0] = CreateVehicle(566, 2001.8361, -1143.2703, 25.3445, 89.0000, -1, -1, 100);
	BallasCar[1] = CreateVehicle(566, 1992.5623, -1128.3490, 25.6445, 89.0000, -1, -1, 100);
	BallasCar[2] = CreateVehicle(517, 2004.4861, -1120.9596, 26.5874, 179.0000, -1, -1, 100);
	BallasCar[3] = CreateVehicle(517, 2013.1475, -1121.1638, 26.5874, 179.0000, -1, -1, 100);
	BallasCar[4] = CreateVehicle(482, 1992.9958, -1119.0502, 26.8656, -90.0000, -1, -1, 100);
	BallasCar[5] = CreateVehicle(567, 2018.8954, -1128.4579, 25.1946, 89.0000, -1, -1, 100);
// EnterVehicle
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    for(new i = 0; i < 12; i++)
    { 
        if(vehicleid == BallasCar[i])
        { 
            if(pInfo[playerid][pMember] != 2) // Change this to your bits
            { 
                ClearAnimations(playerid); 
                SendClientMessage(playerid, -1, "[Los Santos Ambulance Service] You need to be a basic paramedic to drive a EMS car."); // Change this to what you want it to say
            } 
        }
        return 1;
}
Just try them and see if that works, because I can't see anything with yours.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)