SA-MP Forums Archive
Help in Making Givemoney - 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: Help in Making Givemoney (/showthread.php?tid=292220)



Help in Making Givemoney - GAMER_PS2 - 23.10.2011

Hey Guys i have other problem besides on my admin script
i was converting my gamemode commands to ZCMD

suddenly...

Givecash and Me Command cant be made because i dont know
how to convert it in ZCMD and sscanf now
heres my problem

Please Help me in making Givemoney and Me Command like this

"USAGE: /givemoney <playerid> <ammount>"

if you give invalid ammount it should be like this

"Ammount Invalid"

Note: its not for admins.

"USAGE: /me <text>"

Here is my other problem besides in this:

Problem 1 - Solve (Some Past Days Ago)
Problem 2 - Solve (Some Past Days Ago)
Problem 3 - Solve (Yesterday)
Problem 4 - https://sampforum.blast.hk/showthread.php?tid=292213
Problem 5 - This is the topic!


Re: Help in Making Givemoney - GAMER_PS2 - 23.10.2011

Comeon i'm starting to all good scripters are not answering my topic they always answer the new one!!!!


Re: Help in Making Givemoney - SmiT - 23.10.2011

pawn Код:
CMD:me(playerid, params[])
{
    new _str[ 128 ], P_NAME[ MAX_PLAYER_NAME ];
    if ( isnull ( params ) ) return SendClientMessage( playerid, -1, #Usage /me <text> );
    GetPlayerName( playerid, P_NAME, MAX_PLAYER_NAME );
    format( _str, 128, "* %s %s", P_NAME, params );
    SendClientMessageToAll( -1, _str );
    return true;
}

CMD:givemoney(playerid, params[])
{
    new _str[ 128 ], P_NAME[ MAX_PLAYER_NAME ], T_NAME[ MAX_PLAYER_NAME ];
    if( sscanf ( params, "ri", params[ 0 ], params[ 1 ] ) ) return SendClientMessage( playerid, -1, #USAGE: /givemoney <playerid> <ammount> );
    if( params[ 0 ] == INVALID_PLAYER_ID ) return SendClientMessage( playerid, -1, #Player offline );
    if( params[ 1 ] > GetPlayerMoney( playerid ) ) return SendClientMessage( playerid, -1, #Invalid ammount );
    GetPlayerName( playerid, P_NAME, MAX_PLAYER_NAME ); GetPlayerName( params[ 0 ], T_NAME, MAX_PLAYER_NAME );
    format( _str, 128, "%s has given %s $%d", P_NAME, T_NAME, params[ 1 ] );
    GivePlayerMoney( params[ 0 ], params[ 1 ] );
    return true;
}
And for the second time, read the RULES.


Re: Help in Making Givemoney - GAMER_PS2 - 23.10.2011

Ok sorry bro i will never never do that again