CMD:givehp(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::."); new targetid, str[128], Float:hpamount; if(sscanf(params, "uu", targetid, hpamount)) return SendClientMessage(playerid, COLOR_WHITE,"/givehp [PlayerID/PartofName] [Health Points]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!"); SetPlayerHealth(targetid, hpamount); format(str, sizeof(str), "[ADMIN] %s given you health points(%d).", playerid, hpamount); SendClientMessage(targetid, COLOR_GREEN, str); return 1; }
CMD:givehp(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new targetid, str[128], Float:hpamount;
if(sscanf(params, "uu", targetid, hpamount)) return SendClientMessage(playerid, COLOR_WHITE,"/givehp [PlayerID/PartofName] [Health Points]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
SetPlayerHealth(targetid, hpamount);
format(str, sizeof(str), "[ADMIN] %s given you health points(%d).", playerid, hpamount);
SendClientMessage(targetid, COLOR_GREEN, str);
}
else
{
SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
}
return 1;
}
Use [pawn] [/pawn] Tags
CMD:givehp ( playerid , params [ ] )
{
if ( PlayerInfo [ playerid ] [ pAdmin ] < 1 ) return SendClientMessage ( playerid , -1 , ".:: You are not authorized to use this command ::." ) ;
new ID , Str [ 128 ] , Float:amnt , pName [ MAX_PLAYER_NAME ] ;
if ( sscanf ( params , "uu" , ID , amnt ) ) return SendClientMessage ( playerid , -1 , "/givehp [PlayerID/PartofName] [Health Points]" ) ;
if ( !IsPlayerConnected ( ID ) ) return SendClientMessage ( playerid , -1 , "[ERROR] Player not connected!" ) ;
else
{
SetPlayerHealth ( ID , amnt ) ;
GetPlayerName ( ID , pName , MAX_PLAYER_NAME ) ;
format ( Str , 128 , "[ADMIN] %s given you health points(%d)." , pName , amnt ) ;
SendClientMessage ( ID , -1 , Str ) ;
return 1;
}
}
if(sscanf(params, "uu", targetid, hpamount))
Specifier(s) Name Example values i, d Integer 1, 42, -10 c Character a, o, * l Logical true, false b Binary 01001, 0b1100 h, x Hex 1A, 0x23 o Octal 045 12 n Number 42, 0b010, 0xAC, 045 f Float 0.7, -99.5 g IEEE Float 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E u User name/id (bots and players) ******, 0 q Bot name/id ShopBot, 27 r Player name/id ******, 42
pawn Код:
Код:
Specifier(s) Name Example values i, d Integer 1, 42, -10 c Character a, o, * l Logical true, false b Binary 01001, 0b1100 h, x Hex 1A, 0x23 o Octal 045 12 n Number 42, 0b010, 0xAC, 045 f Float 0.7, -99.5 g IEEE Float 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E u User name/id (bots and players) ******, 0 q Bot name/id ShopBot, 27 r Player name/id ******, 42 |