Public feed #378853

tight commands

public cpp v1 · immutable
Raw Edit
·published 2007-03-02 20:50 UTC
rendered paste body
// Read the command correctly so it's not triggered by "/givehealthwithextrastuff"if (!strcmp(cmdtext, "/givehealth", true, 11) && (!cmdtext[11] || cmdtext[11] == ' ')){	new pos;	if (!cmdtext[11] || (pos = strfind(cmdtext, " ", .pos = 12)) == -1)	{		SendClientMessage(playerid, 0xFF0000AA, "Useage: /givehealth <playerid> <health>");	}	else	{		new val = strval(cmdtext[12]);		if (val >= MAX_PLAYERS || val < 0)		{			SendClientMessage(playerid, 0xFF0000AA, "Please enter a valid playerid");		}		else		{			new Float:health;			GetPlayerHealth(val, health);			health += floatstr(cmdtext[pos]);			SetPlayerHealth(val, health);		}	}		return 1;}