31.07.2017, 09:55
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:
and later
also you can make a function like this which returns the level:
and will be able to check player level like that:
hope that helped xd.
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(playerid, money, 2, 1);
pInfo[playerid][pMoney] += money;
}
else
{
if(DowntimeMode == 1)
{
money += 8500;
ShowNotMsg(playerid, money, 5, 1);
pInfo[playerid][pMoney] += money;
}
else
{
if(ChristmasMode == 1)
{
if(pInfo[playerid][pVipLevel] >= 1)
{
money += 4500;
ShowNotMsg(playerid, money, 3, 1);
pInfo[playerid][pMoney] += money;
}
else
{
money += 2500;
ShowNotMsg(playerid, money, 2, 1);
pInfo[playerid][pMoney] += money;
}
}
else
{
ShowNotMsg(playerid, money, 0, 1);
pInfo[playerid][pMoney] += money;
}
}
}
return 1;
}
PHP код:
CallRemoteFunction("GiveMoney", "id", i(orplayerid), 10000);
PHP код:
forward public GetPlayerLevelz(playerid);
public GetPlayerLevelz(playerid)
{
return pInfo[playerid][pAdminLevel];
}
PHP код:
if(CallRemoteFunction("GetPlayerLevelz", "i", playerid) > 0)
{
}
