Wont work
#1

hey guys i have this textdraw when i /buyvehicle and i try to buy a vehicle that is 18,000,000$ and i have only 2kk at me and i can buy it why what is wrong here ?

Код HTML:
if(playertextid == DSBuy)
    {
        if(DSModels[DealerID[playerid]][dPrice] > GetPlayerCash(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"Tu nu ai suficienti bani pentru acest vehicul!");
   		if(DSModels[DealerID[playerid]][dStock] == 0) return SendClientMessage(playerid,COLOR_ERROR,"Acest vehicul nu se mai afla in stoc!");
  		if(PlayerInfo[playerid][pDrivingLic] <= 0) return SendClientMessage(playerid, COLOR_ERROR, "You don't have driving license.");
		vDBID[ VehicleDealer[playerid] ] = 0;
        DestroyVehicle(VehicleDealer[playerid]);
	    InsertCar(playerid, DSModels[SelectedCar[playerid][DealerID[playerid]]][dModel]);
	    TogglePlayerControllableEx(playerid, 1);
		SetCameraBehindPlayer(playerid);
		SetPlayerVirtualWorld(playerid,0);
		SetPlayerPos(playerid, 323.5197,-1519.8727,36.0391);
		CancelSelectTextDraw(playerid);
		HideDSTD(playerid);
		InDealer[playerid] = 0;
    }
only 1 car isn't working , all of them have the right price
Reply
#2

Hello.

Can you write it like this and show us what is printing in the console (server.log)?
PHP код:
if(playertextid == DSBuy)
{
    
printf("$%d - $%d",DSModels[DealerID[playerid]][dPrice],GetPlayerCash(playerid));
    if(
DSModels[DealerID[playerid]][dPrice] > GetPlayerCash(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"Tu nu ai suficienti bani pentru acest vehicul!");
    if(
DSModels[DealerID[playerid]][dStock] == 0) return SendClientMessage(playerid,COLOR_ERROR,"Acest vehicul nu se mai afla in stoc!");
    if(
PlayerInfo[playerid][pDrivingLic] <= 0) return SendClientMessage(playeridCOLOR_ERROR"You don't have driving license.");
    
vDBIDVehicleDealer[playerid] ] = 0;
    
DestroyVehicle(VehicleDealer[playerid]);
    
InsertCar(playeridDSModels[SelectedCar[playerid][DealerID[playerid]]][dModel]);
    
TogglePlayerControllableEx(playerid1);
    
SetCameraBehindPlayer(playerid);
    
SetPlayerVirtualWorld(playerid,0);
    
SetPlayerPos(playerid323.5197,-1519.8727,36.0391);
    
CancelSelectTextDraw(playerid);
    
HideDSTD(playerid);
    
InDealer[playerid] = 0;

Take this vehicle which doesn't work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)