Please help, command is bugged
#1

The command is not good.


Код:
CMD:callmedic(playerid, params[]) {
if(medic[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: You have called medic!");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
hivo = playerid;
fogadva[playerid] = 0;
y1 = y;
x1 = x;
z1 = z;
for(new i=0;i<MAX_PLAYERS;i++) {
if(gTeam[i] == TEAM_MENTO) {
	
if(IsPlayerConnected(i)) {
new str[128];
GetPlayerName(playerid,str,sizeof(str));
mento1[playerid] = 1;
format(str,sizeof(str),"%s has called the medic Call accept: /mentoaccept",str);
SendClientMessage(i,COLOR_WHITE,str);


}else{

    
      
         if(NoMedic < 1)
         {
            SendClientMessage(playerid, COLOR_GREY, " no paramedic service");
            SendClientMessage(playerid, COLOR_GREEN, "You have been automatice healed");

		    ClearAnimations(playerid);
            SetPlayerHealth(playerid,90);
            animba[playerid] = 0;

		    TogglePlayerControllable(playerid, 1);
			if(animba[playerid] == 0)
			{
 			SendClientMessage(playerid,COLOR_RED,"You are not in anim");
	}
      }
      }
      }
   }

return 1;
}
Reply
#2

istenem abba a gyors formбtokba faszopok.
Reply
#3

This give any errors/warnings? If yes post them
Reply
#4

Try this..:
pawn Код:
CMD:callmedic(playerid, params[])
{
    if(medic[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: You have called medic!");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    hivo = playerid;
    fogadva[playerid] = 0;
    y1 = y;
    x1 = x;
    z1 = z;
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            if(gTeam[i] == TEAM_MENTO)
            {
                new str[128];
                GetPlayerName(playerid,str,sizeof(str));
                mento1[playerid] = 1;
                format(str,sizeof(str),"%s has called the medic Call accept: /mentoaccept",str);
                SendClientMessage(i,COLOR_WHITE,str);
            }
            else if(NoMedic < 1)
            {
                SendClientMessage(playerid, COLOR_GREY, " no paramedic service");
                SendClientMessage(playerid, COLOR_GREEN, "You have been automatice healed");
                ClearAnimations(playerid);
                SetPlayerHealth(playerid,90);
                animba[playerid] = 0;
                TogglePlayerControllable(playerid, 1);
            }
            else if(animba[playerid] == 0)
            {
                SendClientMessage(playerid,COLOR_RED,"You are not in anim");
            }
        }
   }
   return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)