Min and Max price for every Vehicle
#1

Hi guys,

I need help to make Minium and Max price for which player can sell vehicle to other player.I don't know what is best way to store ModelID,minimum Price,and Max price.

1) If price is < minimum ; set : minimum price
2) If price is > max ; set : max price
3) If price is between min and max; set: selected price

Thank you
Reply
#2

You need to identify a min/max price for each vehicle, and compare the input price with the min/max.
Reply
#3

Yes,I know.But my question is how to store it?
Reply
#4

https://sampwiki.blast.hk/wiki/Clamp
Reply
#5

Quote:
Originally Posted by Calisthenics
View Post
I understand it.But my question is : How to store min and max price?

How that I insert max and min price for INfernus(411) and then check it?
Reply
#6

PHP Code:
#include <a_samp>
#include <zcmd>
static car_prices[][] =
{
    {
100000/*min*/200000/*max*/}, {300000/*min*/400000/*max*/}, {1200000/*min*/1500000/*max*/}
};
CMD:cprice(playeridparams[])
{
    new 
str[60];
    
format(strsizeof(str), "car id: %d, min price: $%d, max price: $%d"strval(params), car_prices[strval(params)-400][0/*min*/], car_prices[strval(params)-400][1/*max*/]);
    
SendClientMessage(playerid, -1str);
    return 
1;
}
CMD:setprice(playeridparams[])
{
    
vehicle_price clamp(strval(params), car_prices[vehicle_model-400][0/*min*/], car_prices[vehicle_model-400][1/*min*/]);
    return 
1;

Reply
#7

Thank you Lokii
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)