31.07.2017, 09:44
So I want to do a callremotefunction from a filterscript but I'm kinda lost in the function of my givemoney.
So here is the code how I give money to players(server-sided) from sharemoney command:
My stock function of givemoney:
Now from the filterscript this is where I have my doubts , would this code work?
or do I have to do something else?
Also how would I check if the player is admin with callremotefunction? would this do ? well I know its pretty messed up just asking if it would work or is there any other check.
So here is the code how I give money to players(server-sided) from sharemoney command:
Код:
pInfo[targetid][pMoney] += givemoney; pInfo[playerid][pMoney] -= givemoney;
Код:
stock 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;
}
Now from the filterscript this is where I have my doubts , would this code work?
Код:
CallRemoteFunction(GiveMoney(i(orplayerid), 10000);
Also how would I check if the player is admin with callremotefunction? would this do ? well I know its pretty messed up just asking if it would work or is there any other check.
Код:
CallRemoteFunction(if(pInfo[playerid][pAdminLevel] >= 1));
