Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. dcmd_heal( playerid, params[] )
  2. {
  3. if( !strlen( params ) ) // The player didn't use any parameter, so send a Usage message.
  4. return SendClientMessage( playerid, 0xFFAA00, "Usage: /heal [id / all]" );
  5.  
  6. if( strcmp( params, "all", true, 3 ) == 0 ) // The player typed "/heal all"
  7. {
  8. for( new i = 0; i < MAX_PLAYERS; i++ ) // Loop through all players and set their health to 100
  9. SetPlayerHealth( i, 100 );
  10.  
  11. SendClientMessage( playerid, OxFFAA00, "All players healed" );
  12. }
  13. else // The player didn't type "/heal all" so we assume they used a player ID
  14. {
  15. new id = strval( params ); // The variable id will be the value of the parameter.
  16. SetPlayerHealth( id, 100 );
  17. SendClientMessage( playerid, 0xFFAA00, "Player healed." );
  18. SendClientMessage( id, 0xFFAA00, "You've been healed." );
  19. }
  20. return true;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement