Warning
#2

Код:
#include <a_samp>
#include <cps>
#include <Dudb>
#include <dutils>
#pragma unused ret_memcpy

public OnPlayerCommandText( playerid, cmdtext[] )
{
							 //GIVECASH///
	new
		cmd1[256],
		idx1;
	cmd1 = strtok(cmdtext, idx1);
	if ( strcmp( "/givecash", cmd1, true ) == 0 || strcmp( "/givemoney", cmd1, true ) == 0 || strcmp(" /pay", cmd1, true ) == 0 )
	{
    new
			tmp[256],
			tmp2[256],
			cmdid,
			ammount;
    tmp = strtok(cmdtext, idx1);
    tmp2 = strtok(cmdtext, idx1);

    if ( !strval( tmp ) || !strval( tmp2 ) ) return SendClientMessage( playerid, light_green, "Usage: /GiveCash [playerid] [ammount]" );

    cmdid = strval(tmp);
    ammount = strval(tmp2);

    if ( IsPlayerConnected( cmdid ) == 0 ) return SendClientMessage( playerid, light_green, "That player is not connected" );
    if ( GetPlayerMoney( playerid ) < ammount ) return SendClientMessage( playerid, light_green, "You don't have enough money" );

    new
			pname[ MAX_PLAYER_NAME ],
			oname[ MAX_PLAYER_NAME ];
    GetPlayerName( playerid, pname, MAX_PLAYER_NAME );
    GetPlayerName( cmdid, oname, MAX_PLAYER_NAME );

    GivePlayerMoney( playerid, -ammount );
    GivePlayerMoney( cmdid, ammount );

    new
			string[256];
    format( string, 256, "You have given \"%s\" $%d", oname, ammount );
    SendClientMessage( playerid, light_green, string );
    format( string, 256, "You have received $%d from \"%s\"", ammount, pname );
    SendClientMessage( cmdid, light_green, string );
    return 1;
	}
	return 0;
}
now good?
Reply


Messages In This Thread
Warning - by Mr_Assassin - 24.04.2009, 20:01
Re: Warning - by Masj - 24.04.2009, 20:06
Re: Warning - by Mr_Assassin - 24.04.2009, 20:13
Re: Warning - by Mr_Assassin - 24.04.2009, 21:08

Forum Jump:


Users browsing this thread: 1 Guest(s)