SA-MP Forums Archive
check a fixed amount of money - 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: check a fixed amount of money (/showthread.php?tid=580715)



check a fixed amount of money - VanillaRain - 07.07.2015

I want to make a FS where i check if a player got a certain amount of cash like:

if player got + 100$ = hey player name ... has got 100$!

and so on

if some of that value isn't listed (mentioned)

it will automatically send a message to a certain person (Admin) like:

Player XY got Z money!

Is this is any way possible to make? THX


Re: check a fixed amount of money - Bingo - 07.07.2015

Yes, But why making on a FS?

Just go through this function(s):

Код:
public OnPlayerSpawn(playerid)
{
   new string[32];
   format(string, sizeof(string), "Your money: $%i.", GetPlayerMoney(playerid));
   SendClientMessage(playerid, 0xFFFFFFAA, string);
}
Got this from SA-MP wiki.

Change the message to SendClientMessageToAll and add 'GetPlayerName' func.


Re: check a fixed amount of money - VanillaRain - 07.07.2015

Quote:
Originally Posted by Bingo
Посмотреть сообщение
Yes, But why making on a FS?

Just go through this function(s):

Код:
public OnPlayerSpawn(playerid)
{
   new string[32];
   format(string, sizeof(string), "Your money: $%i.", GetPlayerMoney(playerid));
   SendClientMessage(playerid, 0xFFFFFFAA, string);
}
Got this from SA-MP wiki.

Change the message to SendClientMessageToAll and add 'GetPlayerName' func.
Because i need to do more things, is a "security" check for some mine other filterscripts


Re: check a fixed amount of money - VanillaRain - 07.07.2015

anyone?


Re: check a fixed amount of money - Sc0pion - 07.07.2015

PHP код:
CMD:checkmoney(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))
    {
        new 
string[127], target;
        if(
sscanf(params"u"target)) return SendClientMessage(playerid0xFFFFFFAA,"USAGE: /checkmoney (id)");
        if(!
IsPlayerConnected(target)) return SendClientMessage(playerid0xFFFFFFAA"ERROR: Player is not connected!");
        
format(string,sizeof(string),"The player has $%d",GetPlayerMoney(target));
        
SendClientMessage(playerid,0xFFFFFFAA,string);
        return 
1;
    }
    else return 
SendClientMessage(playerid0xFFFFFFAA,"ERROR: You are not an admin to use this command");




Re: check a fixed amount of money - VanillaRain - 07.07.2015

Quote:
Originally Posted by Sc0pion
Посмотреть сообщение
PHP код:
CMD:checkmoney(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))
    {
        new 
string[127], target;
        if(
sscanf(params"u"target)) return SendClientMessage(playerid0xFFFFFFAA,"USAGE: /checkmoney (id)");
        if(!
IsPlayerConnected(target)) return SendClientMessage(playerid0xFFFFFFAA"ERROR: Player is not connected!");
        
format(string,sizeof(string),"The player has $%d",GetPlayerMoney(target));
        
SendClientMessage(playerid,0xFFFFFFAA,string);
        return 
1;
    }
    else return 
SendClientMessage(playerid0xFFFFFFAA,"ERROR: You are not an admin to use this command");

I would like to know if a player got + 100 he will get -100


Re: check a fixed amount of money - VanillaRain - 07.07.2015

anyone?


Re: check a fixed amount of money - VanillaRain - 08.07.2015

BUUUUUUUUUUUMP


Re: check a fixed amount of money - X337 - 08.07.2015

Use ALS system
Код:
stock New_GivePlayerMoney(playerid, value)
{
    new msg[128];
    format(msg, sizeof(msg), "hey bro, u got %d$!", value);
    SendClientMessage(playerid, -1, msg);
    return GivePlayerMoney(playerid, value);
}
#if defined _ALS_GivePlayerMoney
    #undef GivePlayerMoney
#else
    #define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney New_GivePlayerMoney



Re: check a fixed amount of money - VanillaRain - 08.07.2015

Quote:
Originally Posted by X337
Посмотреть сообщение
Use ALS system
Код:
stock New_GivePlayerMoney(playerid, value)
{
    new msg[128];
    format(msg, sizeof(msg), "hey bro, u got %d$!", value);
    SendClientMessage(playerid, -1, msg);
    return GivePlayerMoney(playerid, value);
}
#if defined _ALS_GivePlayerMoney
    #undef GivePlayerMoney
#else
    #define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney New_GivePlayerMoney
I would like to know:


If PlayerMoney increased by 100, Them will be deducted by 100.


So if Player got 49765$ and suddenly he got 49865 they increased by 100, then -100.



Clear now?