20.04.2011, 12:10
Can i make a command that when someone type /givebeer [player id] will give special action beer to the player?
COMMAND:shop(playerid, params[]) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{000FFF}What you want?", "{33CC99}Sprunk ($2)\n{FF0000}Beer ($5)\n{993300}Wine ($8)\n{66FF00}Health($3000)", "Buy", "Cancel"); return 1; }
CMD:givebeer( playerid, params[ ] )
{
new id = strval( params );
if( isnull( id ) ) return SendClientMessage( playerid, 0xAAAAAA, "Usage: /givebeer [ID]! " ) ;
if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, 0xAAAAAA, "Invalid ID! " );
return SetPlayerSpecialAction( id, SPECIAL_ACTION_DRINK_BEER );
}
ZCMD:
pawn Код:
|
if( !strcmp( cmdtext, "/givebeer", true, 9 ) )
{
new id = strval( cmdtext[ 10 ] );
if( !cmdtext[ 10 ] ) return SendClientMessage( playerid, 0xAAAAAA, "Usage: /givebeer [ID]! " ) ;
if( !IsPlayerConnected( id ) || id == INVALID_PLAYER_ID ) return SendClientMessage( playerid, 0xAAAAAA, "Invalid ID! " );
return SetPlayerSpecialAction( id, SPECIAL_ACTION_DRINK_BEER );
}
pawn Код:
|
pawn Код:
|