Big Problem , need help!
#1

Hello , today I discovered i have an big problem at GM

Sometimes when I enter in an personal car (OWnableCar) appear Price /v buy etc etc, but sometimes no, and when it didn't appear all players can drive that car. And if i exit / enter in car many times , appear again price /v buy , how can I make to appear everytime? I tryed so many solutions but didn't work.

Somebody please help me.
Reply
#2

could you show your script where is should show the price?
Reply
#3

Show us the code?How are we supossed to guess all your Vehicle ownerShip code?
Reply
#4

Its a lot of code , what part of code need to show? oH , that with price?

Quote:

if(IsAnOwnableCar(newcar))
{
if(CarInfo[newcar][cOwned]==0)
{
TogglePlayerControllable(playerid, 0);
format(string,sizeof(string),"~w~Vehicle: %s~n~Price: ~g~%d~n~~w~/v buy to buy this vehicle~n~~r~/exit ~w~to exit this vehicle",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
GameTextForPlayer(playerid,string,5000,5);
TogglePlayerControllable(playerid, 0);
}
if(CarInfo[newcar][cOwned]==1)
{
TogglePlayerControllable(playerid, 0);
format(string,sizeof(string),""color_grey"Vehicul inregistrat pe numele:"wh" %s",CarInfo[newcar][cOwner]);
SendClientMessage(playerid, COLOR_BLUE, string);
SendClientMessage(playerid, COLOR_BLUE, "Scrie /v engine pentru a porni motorul");
if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
//else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
else
{
if(PlayerInfo[playerid][pAdmin] >= 1338 && AdminDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You can drive this car because you are admin on duty !");
//gEngine[playerid] = 1;
TogglePlayerControllable(playerid, 1);
}
else
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
}
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}

But I Dont know if it is from here , 'cuz i modified every Playercontrollable with 0 and 1 but without any chance
Reply
#5

Up, please help me
Reply
#6

I hope that piece of code is placed on OnPlayerStateChange,and when the player is a driver,everything starts working,right?
Reply
#7

Yes It is

Repeat:

When I connect and enter in an personal car work 1-2 cars but after the Price and details about the car doesen't appear anymore , and need to enter/exit car few times

Cjgogo please read your PM
Reply
#8

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(IsAnOwnableCar(newcar))
{
if(CarInfo[newcar][cOwned]==0)
{
TogglePlayerControllable(playerid, 0);
format(string,sizeof(string),"~w~Vehicle: %s~n~Price: ~g~%d~n~~w~/v buy to buy this vehicle~n~~r~/exit ~w~to exit this vehicle",CarInfo[newcar][cDescription],CarInfo[newcar][cValue]);
GameTextForPlayer(playerid,string,5000,5);
TogglePlayerControllable(playerid, 0);
}
if(CarInfo[newcar][cOwned]==1)
{
TogglePlayerControllable(playerid, 0);
format(string,sizeof(string),""color_grey"Vehicul inregistrat pe numele:"wh" %s",CarInfo[newcar][cOwner]);
SendClientMessage(playerid, COLOR_BLUE, string);
SendClientMessage(playerid, COLOR_BLUE, "Scrie /v engine pentru a porni motorul");
if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
//else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
else
{
if(PlayerInfo[playerid][pAdmin] >= 1338 && AdminDuty[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You can drive this car because you are admin on duty !");
//gEngine[playerid] = 1;
TogglePlayerControllable(playerid, 1);
}
else
{
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
}
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}
    }
  return 1;
}
Place the code in the function OnPlayerStateChange,so when you enter your car,the code starts working,uunderstand?
Reply
#9

It is already (Este deja)
Reply
#10

Somebody? please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)