03.12.2011, 17:03
id use sscanf as str is slower and also i believe you need :
code might be wrong but the idea is there havent tested it,
also need to include sscanf at the top of your script
and need to define the colour red
i dont no its hex value off by heart
you could also add if player doesnt have enough cash then say so or this:
PHP код:
CMD:give( playerid, params[ ] )
{
new money;
new giveplayerid [MAX_PLAYER_NAME];
if ( sscanf( params, "ui", giveplayerid, money) ) return SendClientMessage( playerid, COLOR_RED, "USAGE: {FFFF00}/give [playerid] [amount]" );
GivePlayerMoney(giveplayerid, money);
GivePlayerMoney(playerid, -money);
return 1;
}
also need to include sscanf at the top of your script
and need to define the colour red
i dont no its hex value off by heartyou could also add if player doesnt have enough cash then say so or this:
PHP код:
if ( giveplayerid == INVALID_PLAYER_ID ) return SendClientMessage( playerid, COLOR_RED, "Player Is Not Connected!" );

