SA-MP Forums Archive
Public Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Public Help (/showthread.php?tid=636484)



Public Help - itachi - 28.06.2017

I need help with public in my gamemode,and callremotefunction in my script.

PUBLIC IN GAMEMODE :
Код:
public GiveMoney(playerid,cash)
{
moneys[playerid] += cash;
return GivePlayerMoney(playerid, cash);
}
STOCK IN SCRIPT :
Код:
stock GiveMoney(playerid,cash)
{
return CallRemoteFunction("GiveMoney","ii",playerid,cash);
}
Script not function give me money


Re: Public Help - KingSenpai - 28.06.2017

You mean, you want give money to player? or to all players?


Re: Public Help - itachi - 28.06.2017

to Player I want cause function GiveMoney from gamemode to my script.


Re: Public Help - Kane - 28.06.2017

Why are you doing it like that though?

Just make either a stock function or public. Why both?

PHP код:
stock GiveMoney(playeridamount)
{
     
Moneys[playerid]+= amount;
     
GivePlayerMoney(playeridamount);
     return 
1;
}
CMD:givemoney(playeridparams[])
{
     new 
playerbamount;
     if(!
IsPlayerAdmin(playerid))return SendClientMessage(playerid, -1"You aren't authorized to use this.");
 
     if(
sscanf(params"ud"playerbamount))return SendClientMessage(playerid, -1"Usage: /givemoney [playerid OR name] [amount]"); 
     if(!
IsPlayerConnected(playerb))return SendClientMessage(playerid, -1"Specified an invalid player.");
     
GiveMoney(playerbamount);
     return 
true;




Re: Public Help - itachi - 28.06.2017

No...
I Have public in my gamemode,but in my gamemode is money functin and this function i want use in script.

so public in my gamemode :

Quote:

public GiveMoney(playerid,cash)
{
moneys[playerid] += cash;
return GivePlayerMoney(playerid, cash);
}

And stock IN script
Quote:

stock GiveMoney(playerid,cash)
{
return CallRemoteFunction("GiveMoney","ii",playerid,cash) ;
}

And i want use example IN SCRIPT :

Quote:

format(s,sizeof(s),"* player %s (ID:%d) winner race price : %d$",PlayerName(i),i,RaceInfo[RaceStartedID][Win]);
SCMTA(ADMINCOL,s);
GiverMoney(i,RaceInfo[RaceStartedID][Win]);

But money not give me