29.01.2011, 10:25
Quote:
Try this
Код:
if(strcmp("/heal", cmdtext, true, 4) == 0) { if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /heal [playerid]"); new gp = strval(cmdtext[8]); if(!IsPlayerConnected(gp)) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Playerid"); new pn[24], an[24], str[70]; GetPlayerName(playerid, an, 24); GetPlayerName(gp, pn, 24); format(str, sizeof(str), "%s is healed by %s", pn, an); SendClientMessageToAll(0xA9A9A9AA, str); SetPlayerHealth(playerid, 100); return 1; } |
Quote:
Код:
CMD:heal(playerid, params[]) { new otherId ; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You're not an admin"); if(!IsPlayerConnected(otherId)) return SendClientMessage(playerid, -1, "ERROR: Invalid ID"); if(sscanf(params, "d", otherId)) return SendClientMessage(playerid, -1, "USAGE: /heal [Name/ID]"); SetPlayerHealth(otherId, 100.0); return 1; } Also if you haven't defined sscanf, then add this native: Код:
native sscanf(const data[], const format[], {Float,_}:...); |
but thanks