SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/05/2019, 03:34 PM   #1
ShaggyShaggy
Little Clucker
 
Join Date: Feb 2019
Posts: 34
Reputation: 0
Default /givemoney

When I use /givemoney playerid money give 0$
Code:
CMD:givemoney(playerid)
{
	new bani, player, playerul[MAX_PLAYER_NAME], admin[MAX_PLAYER_NAME], string[128], string2[128];
 	GetPlayerName(player, playerul,sizeof(playerul));
        GetPlayerName(playerid, admin, sizeof(admin));
    
    
	format(string, sizeof(string), "Admin-ul %s ti-a dat %d lei.", admin, bani);
	SendClientMessage(player,verde_deschis,string);
	
	format(string2, sizeof(string2), "I-ai dat %d lei lui %s.", bani, playerul);
	SendClientMessage(playerid,verde_deschis,string2);
	GivePlayerMoney(player, bani);
	return 1;
}
ShaggyShaggy is offline   Reply With Quote
Old 17/05/2019, 03:39 PM   #2
Heress
Huge Clucker
 
Heress's Avatar
 
Join Date: Mar 2018
Location: Lithuania
Posts: 261
Reputation: 7
Default Re: /givemoney

You should use sscanf
__________________
==============
Sorry for my bad English









Respect: Kalcor, ******. Thank you for this great game!
Heress is offline   Reply With Quote
Old 17/05/2019, 03:44 PM   #3
ShadowMortar
Big Clucker
 
Join Date: Jul 2016
Location: a
Posts: 121
Reputation: 6
Default Re: /givemoney

PHP Code:
CMD:givemoneyplayeridparams[ ] )
{
    new 
baniplayerplayerulMAX_PLAYER_NAME ], adminMAX_PLAYER_NAME ], string128 ], string2128 ];
     
GetPlayerNameplayerplayerul,sizeofplayerul ) );
    
GetPlayerNameplayeridadminsizeofadmin ) );
    if( 
sscanfparams"ui"playerbani ) ) SendClientMessageplayerid, -1"Usage: /givemoney <player> <bani>");
    else
    {
        
formatstringsizeof( string ), "Admin-ul %s ti-a dat %d lei."adminbani);
        
SendClientMessage(player,verde_deschis,string);
        
        
formatstring2sizeof(string2), "I-ai dat %d lei lui %s."baniplayerul );
        
SendClientMessageplayerid,verde_deschis,string2 );
        
GivePlayerMoneyplayerban i);
    }
    return 
1;

ShadowMortar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cmd givemoney IceWizz Scripting Help 3 12/04/2017 09:24 AM
/givemoney value too big UltraScripter Scripting Help 12 10/11/2014 02:40 PM
[HELP] /givemoney MiGu3X Scripting Help 2 15/02/2013 12:40 AM
/givemoney Blackazur Scripting Help 7 16/11/2012 04:10 PM
/givemoney cmd help Face9000 Scripting Help 2 19/03/2012 09:25 PM


All times are GMT. The time now is 06:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.