09.08.2011, 21:06
I made a script which you can sell cars, the problem is that I want any random car you enter will either say you can sell this vehicle or not. If I go into a random sellable vehicle, it will say "you can sell this car for [$amount$]". But if I were to exit it and re-enter it again, it will say it's not sellable. I made a variable called insellablecar[MAX_PLAYERS] and set the value to 1 if they enter the random sellable vehicle. Here is the code:
I know this won't and didn't work properly, but does anyone know how to fix it? Sorry if it is confusing lol :/
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new rand = random(15);
if(rand >= 0 && rand <= 6)
{
new string[128];
new Value = GetVehicleValue(playerid);
SellableVehicle[GetPlayerVehicleID(playerid)] = 1;
insellablecar[playerid] = 1;
format(string,sizeof(string),"You Can Sell This Vehicle At The Crane For $%d.",Value);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
format(string,sizeof(string),"~w~SELL THIS VEHICLE AT ~N~THE CRANE FOR $%d",Value);
GameTextForPlayer(playerid, string, 4000,3);
}
else if(rand >= 7 && rand <= 15)
{
insellablecar[playerid] = 0;
if(insellablecar[playerid] == 0)
{
return SendClientMessage(playerid,red,"Welcome Back To Your Vehicle.");
}
}
}