Script
#1

Hi can you guys please change this heal command and armour command for zcmd instead of strcmp and to use sscanf:

Health command
Код:
//-------------------------------[sethp]----------------------------------------
	if(strcmp(cmd, "/sethp", true) == 0)
	{
		if(PlayerInfo[playerid][pAdmin] < 4) return DenyMessage(playerid, 4);
	    new tmp2[256];
	    tmp = strtok(cmdtext, idx);
		new otherplayer = ReturnUser(tmp);
		tmp2 = strtok(cmdtext, idx);
		new hp = strval(tmp2);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "USAGE: /sethp [playerid] [ammount]");
		if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "USAGE: /sethp [playerid] [ammount]");
		if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
	    SetPlayerHealth(otherplayer, hp);
		return 1;
	}
the armour command:

Код:
//------------------------------[setarmor]--------------------------------------
    if(strcmp(cmd, "/setarmor", true) == 0)
	{
		if(PlayerInfo[playerid][pAdmin] < 5) return DenyMessage(playerid, 5);
	    new tmp2[256];
	    tmp = strtok(cmdtext, idx);
		new otherplayer = ReturnUser(tmp);
		tmp2 = strtok(cmdtext, idx);
		new hp = strval(tmp2);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "USAGE: /setarmor [playerid] [ammount]");
		if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "USAGE: /setarmor [playerid] [ammount]");
		if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
		SetPlayerArmour(otherplayer, hp);
		return 1;
	}
Thanks
Reply


Messages In This Thread
Script - by NTS - 07.08.2011, 13:16
Re: Script - by Mujib - 07.08.2011, 13:23

Forum Jump:


Users browsing this thread: 1 Guest(s)