What's the problem here?
#1

I tried to make the heal command compile and it worked(no compiling errors) but in game it's not working:

pawn Код:
#include <a_samp>
#include <sscanf2>

public OnPlayerCommandText(playerid,cmdtext[])
{
   dcmd(heal,4,cmdtext);
   return 0;
}

stock Float:GetDistanceBetweenPlayers(p1,p2)
{
        new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
        if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
        {
                return -1.00;
        }
        GetPlayerPos(p1,x1,y1,z1);
        GetPlayerPos(p2,x2,y2,z2);
        return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}


dcmd_heal(playerid,params[])
{
    new gTeam1[MAX_PLAYERS];
    if(gTeam1[playerid] == TEAM_MEDICS)
    {
       new Float:phealth;
       new pName[MAX_PLAYER_NAME];
       new targetid, string[128];
       GetPlayerHealth(targetid,phealth);
       if(sscanf(params,"uz",targetid)) return SendClientMessage(playerid,RED,"Usage: /heal [playerid]");
       if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,RED,"Player is not connected or is yourself.");
       if(GetDistanceBetweenPlayers(playerid,targetid) > 4) return SendClientMessage(playerid,RED,"Player is too far away");
       if(GetDistanceBetweenPlayers(playerid,targetid) < 4)
       {
         format(string,sizeof(string),"%s has been healed by medic %d",pName);
         SendClientMessageToAll(YELLOW,string);
         SetPlayerHealth(targetid,100);
         GivePlayerMoney(playerid,300);
         GivePlayerMoney(targetid,-250);
       }
    }
    return 1;
}
I have the incldues and plugins and edited server.cfg I am evry sure so what's the problem?
Reply


Messages In This Thread
What's the problem here? - by Cjgogo - 01.05.2011, 15:42
Re: What's the problem here? - by Cjgogo - 02.05.2011, 13:16
Re: What's the problem here? - by Wesley221 - 02.05.2011, 13:22
Re: What's the problem here? - by Cjgogo - 02.05.2011, 13:49
Re: What's the problem here? - by Vince - 02.05.2011, 14:20
Re: What's the problem here? - by Cameltoe - 02.05.2011, 14:23
Re: What's the problem here? - by Cjgogo - 02.05.2011, 14:56

Forum Jump:


Users browsing this thread: 1 Guest(s)