Command help..
#2

pawn Код:
CMD:heal(playerid, params[])
{
    foreach(Player,i)
   {
      if(gTeam[i] == gTeam[playerid])
      {
        if(gClass[playerid] != CLASS_SNIPER) return SP red, "You need to be Sniper(Rank"#SNIPER_RANK") to use this command");
        {
            if(heal_timer[playerid] > 0) return SP COLOR_RED, "[ERROR]: You need to wait for 25 seconds to use this command again");
            heal_timer[playerid] = heal_time;
            new targetid, str[50], str2[50], id;
            if(sscanf(params, "uu", targetid, id)) return SendClientMessage(playerid, -1 , "You cannot heal yourself");
            if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF,"Usage: /heal [Player id]");
            if(playerid == id) return SendClientMessage(playerid, red, "You cannot heal your self.");
            if(!IsPlayerConnected(targetid)) return SP red, "The id you're looking for seems not to be online");
            SetPlayerHealth(playerid, 100);
            format(str, sizeof(str), "Sniper %s has healed you", GetName(playerid));
            SendClientMessage(targetid, COLOR_LIMEGREEN, str);
            format(str2, sizeof(str2), "You have healed %s he might be thankful to you now", GetName(targetid));
            SendClientMessage(playerid, COLOR_LIMEGREEN, str2);
           
        }
    }else return SendClientMessage(playerid, red, "This player is not in your team");
 }
 return 1;
}
Also this.. it gives no errors at all.. but I can't use it in Game, i've made a timer to prevent the player from using it if 60 seconds have not passed, but there is a problem, and it's with sscanf if someone could tell me how to fix it please.... Help will be very appreciated. thanks
Reply


Messages In This Thread
Please help me to fix those commands - by Strier - 03.02.2013, 23:34
Respuesta: Command help.. - by Strier - 04.02.2013, 00:43
Re: Command help.. - by lean1337 - 04.02.2013, 11:27

Forum Jump:


Users browsing this thread: 1 Guest(s)