Help With Jakhouse
#1

Sorry for making the same thread as before .. but I think no one understands me, so I will make a new thread to make sure anyone understand what am I saying.

I use JakHouse system for my server, and my gamemode have a serverside money function. So, when I try to buy a house, it makes my money turn negative, yes I use CallRemoteFunction to call my serverside money in my gamemode. Same goes to storing cash (jakhouse). And btw the serverside money that I use is the one from this tutorial : https://sampforum.blast.hk/showthread.php?tid=71136

Serverside money function inside my gamemode :
PHP код:
forward GivePlayerCash(playeridmoney);
public 
GivePlayerCash(playeridmoney)
{
    
Account[playerid][Money] += money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridAccount[playerid][Money]);
    return 
Account[playerid][Money];
}
forward SetPlayerCash(playeridmoney);
public 
SetPlayerCash(playeridmoney)
{
    
Account[playerid][Money] = money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridAccount[playerid][Money]);
    return 
Account[playerid][Money];
}
forward ResetPlayerCash(playerid);
public 
ResetPlayerCash(playerid)
{
    
Account[playerid][Money] = 0;
    
ResetPlayerMoney(playerid);
    
GivePlayerCash(playeridAccount[playerid][Money]);
    return 
Account[playerid][Money];
}
forward GetPlayerCash(playerid);
public 
GetPlayerCash(playerid)
{
    return 
Account[playerid][Money];

Buyhouse in JakHouse :
PHP код:
CMD:buyhouse(playeridparams[])
{
    new
        
string[128]
    ;
    new 
h_ID[playerid];
    if(
== -1) return SendClientMessage(playeridCOLOR_RED"<!>[Server] Mana Umah , Aku xleh detect . Duduk leklok la aduh..");
    if(
IsPlayerInRangeOfPoint(playerid1.5hInfo[i][hPickupP][0], hInfo[i][hPickupP][1], hInfo[i][hPickupP][2]))
    {
        if(
hInfo[i][hSale] == 1) return SendClientMessage(playeridCOLOR_RED"<!> This house isn't for sale."); 
        if(
CallRemoteFunction("GetPlayerCash""i"playerid) < hInfo[i][hPrice]) return SendClientMessage(playeridCOLOR_RED"<!>[InvalidMoney] Kau tak cukup duit , jadi homeless sng.");
        if(
jpInfo[playerid][OwnedHouses] > 2) return SendClientMessage(playeridCOLOR_RED"<!> Max house limit is 3! You can't buy more house than that!");
        
jpInfo[playerid][OwnedHouses]++;
        
jpInfo[playerid][p_SpawnPoint][0] = hInfo[i][hEnterPos][0];
        
jpInfo[playerid][p_SpawnPoint][1] = hInfo[i][hEnterPos][1];
        
jpInfo[playerid][p_SpawnPoint][2] = hInfo[i][hEnterPos][2];
        
jpInfo[playerid][p_SpawnPoint][3] = hInfo[i][hEnterPos][3];
        
jpInfo[playerid][p_Interior] = hInfo[i][hInterior];
        
hInfo[i][hSale] = 1;
        
hInfo[i][hLocked] = 0;
        
format(hInfo[i][hOwner], 256"%s"p_Name(playerid));
        
CallRemoteFunction("GivePlayerCash""dd"playerid, -hInfo[i][hPrice]);
        
format(string128"You have bought this house for $%d."hInfo[i][hPrice]);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
        
        
SaveHouse(i);
        
DestroyDynamicCP(hInfo[i][hCP]);
        
DestroyDynamicPickup(hInfo[i][hPickup]);
        
DestroyDynamicMapIcon(hInfo[i][hMapIcon]);
        
DestroyDynamic3DTextLabel(hInfo[i][hLabel]);
        
        
LoadHouse(i);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"[Server] Mana Umah , Aku xleh detect . Duduk leklok la aduh..");
    }
    return 
1;

Store cash thing from JakHouse :
PHP код:
if(dialogid == DIALOG_HSTOREC)
    {
        if(
response)
        {
            if(!
strlen(inputtext))
            {
                
ShowPlayerDialog(playeridDIALOG_HSTORECDIALOG_STYLE_INPUT""green"Store Cash ($)",\
                
""white"You are now storing your money into your house safe.\nPut the amount of cash you want to store into your house. (E.G. 500)""Configure""Back");
                return 
1;
            }
            if(!
isnumeric(inputtext))
            {
                
ShowPlayerDialog(playeridDIALOG_HSTORECDIALOG_STYLE_INPUT""green"Store Cash ($)",\
                
""white"You are now storing your money into your house safe.\nPut the amount of cash you want to store into your house. (E.G. 500)\n\n"red"[Error]Do you want to deposit alphabets ? LMAO.""Configure""Back");
                return 
1;
            }
            if(
strval(inputtext) > CallRemoteFunction("GetPlayerCash""i"playerid))
            {
                
ShowPlayerDialog(playeridDIALOG_HSTORECDIALOG_STYLE_INPUT""green"Store Cash ($)",\
                
""white"You are now storing your money into your house safe.\nPut the amount of cash you want to store into your house. (E.G. 500)\n\n"red"[Error]You dont have that amount of money""Configure""Back");
                return 
1;
            }
            
CallRemoteFunction("GivePlayerCash""dd", -strval(inputtext));
            
hInfo[hid][MoneyStore] = hInfo[hid][MoneyStore] + strval(inputtext);
            new 
string[128];
            
format(string128"You have store your $%d into your house safe. ($%d over all in your safe)"strval(inputtext), hInfo[hid][MoneyStore]);
            
SendClientMessage(playerid, -1string);
            
SaveHouse(hid);
            
DestroyDynamicCP(hInfo[hid][hCP]);
            
DestroyDynamicPickup(hInfo[hid][hPickup]);
            
DestroyDynamicMapIcon(hInfo[hid][hMapIcon]);
            
DestroyDynamic3DTextLabel(hInfo[hid][hLabel]);
            
LoadHouse(hid);
            
cmd_hmenu(playerid"");
        }
        else
        {
            
cmd_hmenu(playerid"");
        }
    } 
I hope you guys understand .. I'm stuck at this problem for 4 days now ..
Reply
#2

ni afiq ke?
ni aq Eman ...
Reply
#3

Just use the one wups made and include the one for the gamemode and the fs one in ur filterscripts.
http://forum.sa-mp.com/showthread.ph...ighlight=money
Reply
#4

I used that script, the thing i did to fix this was adding the money system of my gamemode into the filterscript.

If your gamemode using for example givePlayerMoneyEx , add the funcs to jakhouse and change the script to these functions.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)