04.12.2010, 07:08
(
Последний раз редактировалось Ash.; 04.12.2010 в 07:16.
Причина: Added Information
)
It may help you to read the wiki (especially on strtok and OnPlayerCommandText)
- If this thread is not properly answered when i get on my laptop i will attempt to help you
This forum requires that you wait 120 seconds between posts. Please try again in 8 seconds.
Edit: Try this...
Remember to change COLOUR to the colour (color) that you want...
- If this thread is not properly answered when i get on my laptop i will attempt to help you
This forum requires that you wait 120 seconds between posts. Please try again in 8 seconds.
Edit: Try this...
pawn Код:
if(strcmp("/aheal", cmdtext) == 0)
{
new idx, pid, tmp, pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME], string[128];
tmp = strtok(cmdtext, idx);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOUR, "Administration Level Required");
if(!strlen(tmp)) return SendClientMessage(playerid, COLOUR, "Usage: /aheal [playerid]");
pid = strval(tmp);
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOUR, "This player is not connected");
SetPlayerHealth(pid, 100.0);
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(pid, pName2, sizeof(pName2));
format(string, sizeof(string), "%s was healed by %s", pName2, pName);
SendClientMessageToAll(COLOUR, string);
}
//Usage: /aheal [playerid]