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
#2

ANYONE please(topic posted yesterday)
Reply
#3

pawn Код:
publicOnPlayerCommandText(playerid,cmdtext[])
Needs to be:
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
You forgot the space between public & OnPlayerCommandText
Reply
#4

IT IS A writing mistake lol in the script is with space so AGAIN what's the problem?
Reply
#5

Quote:
Originally Posted by Cjgogo
Посмотреть сообщение
pawn Код:
new gTeam1[MAX_PLAYERS];
if(gTeam1[playerid] == TEAM_MEDICS)
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
LOL.
Reply
#7

lol good photo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)