CallRemotefunction(server-sided money)
#4

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Well, CallRemoteFunction calls a forwarded and public function not stock...
you can return a value in ur public function and callremotefunction will return this value for you.

so it would be:

PHP код:
forward public GiveMoney(playerid,money);
public 
GiveMoney(playerid,money)
{
    if(
HalloweenMode == 1)
    {
        
money += 2500;
        
ShowNotMsg(playeridmoney21);
        
pInfo[playerid][pMoney] += money;
    }
    else
    {
        if(
DowntimeMode == 1)
        {
            
money += 8500;
            
ShowNotMsg(playeridmoney51);
            
pInfo[playerid][pMoney] += money;
        }
        else
        {
            if(
ChristmasMode == 1)
            {
                if(
pInfo[playerid][pVipLevel] >= 1)
                {
                      
money += 4500;
                    
ShowNotMsg(playeridmoney31);
                    
pInfo[playerid][pMoney] += money;
                }
                else
                {
                     
money += 2500;
                    
ShowNotMsg(playeridmoney21);
                    
pInfo[playerid][pMoney] += money;
                }
            }
            else
            {
                
ShowNotMsg(playeridmoney01);
                
pInfo[playerid][pMoney] += money;
            }
        }
    }
    return 
1;

and later

PHP код:
CallRemoteFunction("GiveMoney""id"i(orplayerid), 10000); 
also you can make a function like this which returns the level:

PHP код:
forward public GetPlayerLevelz(playerid);
public 
GetPlayerLevelz(playerid)
{
    return 
pInfo[playerid][pAdminLevel];

and will be able to check player level like that:
PHP код:
if(CallRemoteFunction("GetPlayerLevelz""i"playerid) > 0)
{

hope that helped xd.
Pretty good explanation thank you but about the money lets say I can do this?
PHP код:
CallRemoteFunction("GiveMoney""id",playerid10000); 
or
PHP код:
CallRemoteFunction("GiveMoney""id"i10000); 
Reply


Messages In This Thread
CallRemotefunction(server-sided money) - by Crystallize - 31.07.2017, 09:44
Re: CallRemotefunction(server-sided money) - by Kane - 31.07.2017, 09:54
Re: CallRemotefunction(server-sided money) - by jlalt - 31.07.2017, 09:55
Re: CallRemotefunction(server-sided money) - by Crystallize - 31.07.2017, 10:03
Re: CallRemotefunction(server-sided money) - by OneDay - 31.07.2017, 10:05
Re: CallRemotefunction(server-sided money) - by jlalt - 31.07.2017, 10:07
Re: CallRemotefunction(server-sided money) - by Crystallize - 31.07.2017, 10:08
Re: CallRemotefunction(server-sided money) - by Shinja - 31.07.2017, 13:58

Forum Jump:


Users browsing this thread: 1 Guest(s)