SA-MP Forums Archive
Changing A Command Type - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Changing A Command Type (/showthread.php?tid=160922)



Changing A Command Type - robert4049 - 18.07.2010

Okay well i belive you can have like on player command text and then you have this. How would i convert this to just the on player command text

Код:
command(heal, playerid, params[])
{
	new	userid, price;
	if (sscanf(params, "ud", userid, price)) SendClientMessage(playerid, COLOR_WHITE, "/heal [playerid] [price]");
	else
	{
		if(IsPlayerConnected(userid))
		{
		    if(DynamicFactions[pStats[playerid][pFaction]][fType] == 2)
		    {
		        if(price >= 500)
		        {
		            SendClientMessage(playerid, COLOR_WHITE, "You're unable to charge above $500.");
		            return 1;
		        }
		    	new string[128];
		    	format(string, sizeof(string), "You have been healed by %s, for $%d.", GetPlayerNameEx(playerid), price);
    			SendClientMessage(userid, COLOR_WHITE, string);
    			SetPlayerHealth(userid, 100);
		    	format(string, sizeof(string), "You have healed %s, for $%d.", GetPlayerNameEx(userid), price);
    			SendClientMessage(playerid, COLOR_WHITE, string);
    		}
    		else
    		{
    		    SendClientMessage(playerid, COLOR_WHITE, "Invalid faction/type");
    		}
		}



Re: Changing A Command Type - robert4049 - 18.07.2010

opp browser mess up when trying to edit post sorry for double post


Re: Changing A Command Type - TheInnocentOne - 18.07.2010

I don't completely understand.. Do you want it so it will work inside OnPlayerCommandText? Without zcmd?


Re: Changing A Command Type - robert4049 - 18.07.2010

Inside OnPlayerCommandText