Public Help
#1

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
Reply
#2

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

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

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;

Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)