07.08.2011, 13:16
Hi can you guys please change this heal command and armour command for zcmd instead of strcmp and to use sscanf:
Health command
the armour command:
Thanks
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;
}
Код:
//------------------------------[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;
}

