just an issue with a sethp cmd
#1

PHP код:
CMD:sethp(playeridparams[])
{
   if(
connected[playerid] == true) return GameTextForPlayer(playerid"~r~Spawn First"50005);
   if(
pInfo[playerid][Admin] < 2) return SendClientMessage(playerid, -1"{C3C3C3}(INFO) You don't have the priviliges to use this command.");
   {
     new 
amountstr[128], target;
     if(!
IsPlayerConnected(target)) return SendClientMessage(playerid, -1"{c3c3c3}(INFO) The player is not connectdd!");
     if(
sscanf(params"ui"targetamount)) return SendClientMessage(playerid, -1"{c3c3c3}(INFO) /sethp [id] [amount]");
     
format(strsizeof(str), "{EFB509}(INFO) You have set %s's health to %d"PlayerName[playerid], amount);
     
SendClientMessage(playerid, -1str);
     
format(strsizeof(str), "{EFB509}(INFO) An admin has set your health to %d"amount);
     
SendClientMessage(target, -1str);
     
SetPlayerHealth(targetamount);
     
format(str,sizeof(str), "{0066ff}(admin) %s has set player's %s HP to %d"PlayerName[playerid], PlayerName[target], amount);
     
SendMessageToAdmins(str);
   }
   return 
1;

Why when i join in local host and type /sethp 1 100 it gives me (id 0) 100 hp ? lol
Reply


Messages In This Thread
just an issue with a sethp cmd - by wallen - 13.03.2018, 19:21
Re: just an issue with a sethp cmd - by AdamsLT - 13.03.2018, 19:27
Re: just an issue with a sethp cmd - by wallen - 13.03.2018, 19:34
Re: just an issue with a sethp cmd - by AdamsLT - 13.03.2018, 19:45
Re: just an issue with a sethp cmd - by ISmokezU - 13.03.2018, 21:37

Forum Jump:


Users browsing this thread: 3 Guest(s)