Buy CMD
#1

ok i type /v buy and it says that i dont have enough money..and i have 10k in my hand..and the vehicle costs 5k..and i have 10k..

PHP код:
else if(strcmp(x_nr,"buy",true) == 0)
            {
                if(
IsAnOwnableCar(idcar))
                {
                    if(
PlayerInfo[playerid][pPcarkey] == -1) { }
                    else if(
PlayerInfo[playerid][pPcarkey2] == -1) { }
                    else if(
PlayerInfo[playerid][pPcarkey3] == -1) { }
                    else { 
SendClientMessage(playeridCOLOR_GREY"   Ai deja 3 masini!!"); return 1; }
                    if(
CarInfo[idcar][cOwned]==1)
                    {
                        
SendClientMessage(playeridCOLOR_GREY"Someone already owns this car");
                        return 
1;
                    }
                    if(
GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])
                    {
                        if(
PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = idcar; }
                        else if(
PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = idcar; }
                        else if(
PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = idcar; }
                        else { return 
1; }
                        
CarInfo[idcar][cOwned] = 1;
                        
GetPlayerName(playeridsendernamesizeof(sendername));
                        
strmid(CarInfo[idcar][cOwner], sendername0strlen(sendername), 999);
                        
GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);
                        
PlayerPlaySound(playerid10520.00.00.0);
                        
GameTextForPlayer(playerid"~w~Felicitari~n~Nu uita sa o parchezi cu /v park!"50003);
                        
SendClientMessage(playeridCOLOR_GRAD2"Felicitari ti-ai cumparat o masina noua!");
                        
TogglePlayerControllable(playerid1);
                        
OnPropUpdate(); SavePlayerData(playerid);
                        return 
1;
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GREY"  You don't have enough cash with you ! ");
                        return 
1;
                    }
                }
            } 
Reply
#2

anyone know??
Reply
#3

Код:
 else if(strcmp(x_nr,"buy",true) == 0) 
            { 
                if(IsAnOwnableCar(idcar)) 
                { 
                    if(PlayerInfo[playerid][pPcarkey] == -1) { } 
                    else if(PlayerInfo[playerid][pPcarkey2] == -1) { } 
                    else if(PlayerInfo[playerid][pPcarkey3] == -1) { } 
                    else { SendClientMessage(playerid, COLOR_GREY, "   Ai deja 3 masini!!"); return 1; } 
                    if(CarInfo[idcar][cOwned]==1) 
                    { 
                        SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car"); 
                        return 1; 
                    } 
                    if(PlayerInfo[playerid][pCash] >= CarInfo[idcar][cValue]) 
                    { 
                        if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = idcar; } 
                        else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = idcar; } 
                        else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = idcar; } 
                        else { return 1; } 
                        CarInfo[idcar][cOwned] = 1; 
                        GetPlayerName(playerid, sendername, sizeof(sendername)); 
                        strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999); 
                        GivePlayerMoney(playerid,-CarInfo[idcar][cValue]); 
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); 
                        GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3); 
                        SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!"); 
                        TogglePlayerControllable(playerid, 1); 
                        OnPropUpdate(); SavePlayerData(playerid); 
                        return 1; 
                    } 
                    else 
                    { 
                        SendClientMessage(playerid, COLOR_GREY, "  You don't have enough cash with you ! "); 
                        return 1; 
                    } 
                } 
            }
Work ?
Reply
#4

the car value?
Reply
#5

it doesent work..i put stock giveplayercash.. and i think that the fs thinks that i have 0$ money..but i have money at me..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)