refill - problem!
#7

For dcmd you only need to put this line below your includes at the top of your script:
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd__%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd__%1(playerid, (%3)[(%2) + 2]))))) return 1
Then you can make a cmd like this:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(heal, 4, cmdtext);
	return 0;
}
 
dcmd_heal(playerid, params[])
{
        new id;
	if (strlen(params))
	{
		id = strval(params);
		if (IsPlayerConnected(id))
		{
			SetPlayerHealth(id, 100.0);
			SendClientMessage(id, 0x00FF00AA, "You have been healed");
			SendClientMessage(playerid, 0x00FF00AA, "Player healed");
		}
		else
		{
			SendClientMessage(playerid, 0xFF0000AA, "Player not found");
		}
	}
	else
	{
		SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
	}
	return 1;
}
And I looked on wiki, it seems the zcmd is faster, I don't know how but it seems to be: here you can find zcmd: clicky
Reply


Messages In This Thread
refill - problem! - by Akcent_Voltaj - 03.10.2012, 11:05
Re: refill - problem! - by Roel - 03.10.2012, 11:32
Re: refill - problem! - by KingHual - 03.10.2012, 11:33
Re: refill - problem! - by Roel - 03.10.2012, 11:36
Re: refill - problem! - by Akcent_Voltaj - 03.10.2012, 11:38
Re: refill - problem! - by KingHual - 03.10.2012, 11:39
Re: refill - problem! - by Roel - 03.10.2012, 11:42
Re: refill - problem! - by Roel - 03.10.2012, 11:44
Re: refill - problem! - by Akcent_Voltaj - 03.10.2012, 11:47
Re: refill - problem! - by KingHual - 03.10.2012, 11:49

Forum Jump:


Users browsing this thread: 4 Guest(s)