cmd not working
#1

Code:
http://pastebin.com/BiWRixpz

OKay, my problem is that when I enter the proper fields out it still keeps saying "Correct usage: /sethealth <playerid> <0-100>"
I tried to troubleshoot through this problem but I cannot figure it out.
Reply
#2

first of all, in sscanf, you should use something else other then playerid... Its already defined in CMD:cmd(playerid, params[]). You never did:

pawn Код:
new id, healthn;
Reply
#3

Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>

new health, otherid;

public OnFilterScriptInit() return 1;
CMD:sethealth(playerid, params[])
{
		if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xff0000FF, "You are not an admin.");
		if(sscanf(params,"ui", otherid, health)) return SendClientMessage(playerid, 0xffffffFF, "Correct usage: /sethealth <playerid> <0-100>");
		if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server");
        SetPlayerHealth(playerid, health);
		return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)