SA-MP Forums Archive
Big Problem , need help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Big Problem , need help! (/showthread.php?tid=332521)



Big Problem , need help! - RaulSTARs - 08.04.2012

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.


Re: Big Problem , need help! - mineralo - 08.04.2012

could you show your script where is should show the price?


Re: Big Problem , need help! - Cjgogo - 08.04.2012

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


Re: Big Problem , need help! - RaulSTARs - 08.04.2012

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


Re: Big Problem , need help! - RaulSTARs - 08.04.2012

Up, please help me


Re: Big Problem , need help! - Cjgogo - 08.04.2012

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


Re: Big Problem , need help! - RaulSTARs - 08.04.2012

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


Re: Big Problem , need help! - Cjgogo - 08.04.2012

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?


Re: Big Problem , need help! - RaulSTARs - 08.04.2012

It is already (Este deja)


Re: Big Problem , need help! - RaulSTARs - 08.04.2012

Somebody? please help