Author Topic: Help !!!  (Read 2278 times)

0 Members and 1 Guest are viewing this topic.

Offline locday123

  • Street Thug
  • *
  • Posts: 25
    • View Profile
Help !!!
« on: January 19, 2011, 01:09:07 pm »
else if (strcmp(cmd, "sethp", true) == 0) {
      new snick[256], plr, health[256], szMsg[256];
      snick = strtok(cmdtext, idx), plr = FindPlayerIDFromString(snick), health = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"sethp")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
                else if(!IsPlayerCommandLevel1(playerid,"sethp")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");

      else if (!strlen(health)) SendClientMessage(playerid,COLOR_GREEN,"USAGE: /c sethp [Nick/ID] [Armour]");
        else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
      else {
         format(szMsg,sizeof(szMsg),"Admin %s changed:[ %s ] health to:[ %d% ]",gPlayers[playerid],gPlayers[plr],strval(health));
         SendClientMessageToAll(COLOR_GREEN,szMsg);
         SetPlayerHealth(plr,strval(health));
      }
      return 1;
   }
   else if (strcmp(cmd, "healall", true) == 0) {
      if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
      else if(!IsPlayerCommandLevel(playerid,"healall")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
      else {
         HealAll();
      }
      return 1;
   }



Everyone can fix my code to fit two conditions to use the command.

I have corrected, but this condition shall not be other conditions

Expect people to help

Thanks

Offline Scripter

  • Wiseguy
  • **
  • Posts: 62
    • View Profile
Re: Help !!!
« Reply #1 on: January 20, 2011, 08:31:58 am »
are u want to any player can use this command so what changes u want in this  cmd  ???