what's wrong with this CMD
#1

pawn Код:
if(strcmp(cmd, "/heal", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /heal [playerid/PartOfName] [Price]");
            return 1;
        }
        giveplayerid = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /heal [playerid/PartOfName] [Price]");
            return 1;
        }
        if(!IsPlayerInRangeOfPlayer(2, playerid, giveplayerid))
        {
            SendClientMessage(playerid, COLOR_GRAD1, "   You are not in range of that player !");
            return 1;
        }
        if(giveplayerid == playerid)
        {
            SendClientMessage(playerid, COLOR_GRAD1, "   You cannot heal yourself !");
            return 1;
        }
        if(PlayerPaused[giveplayerid] == 1)
        {
            SendClientMessage(playerid, COLOR_GRAD1, "   You cannot heal someone who's tabbed !");
            return 1;
        }
        if(IsPlayerConnected(giveplayerid))
        {
            if(giveplayerid != INVALID_PLAYER_ID)
            {
                strmid(giveplayer, PlayerRPName(giveplayerid), 0, MAX_PLAYER_NAME);
                strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);

                if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
                {
                    if(IsPlayerConnected(playerid))
                    {
                        new Float:tempheal;
                        GetPlayerHealth(giveplayerid,tempheal);
                        if(tempheal >= 100.0)
                        {
                            SendClientMessage(playerid, COLOR_GRAD1,"   That person is fully healed or that person is not injured!");
                            return 1;
                        }
                        SendClientMessage(giveplayerid, COLOR_GRAD1, "   You have been fully healed.");
                        PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
                        format(string, sizeof(string), "* Paramedic %s has healed %s for $%d.", sendername,giveplayer,moneys);


when i do /heal (id) (price) it says : You have been fully healed.
but the player's heal not full , still same ...

rip english, sorry guys
Reply
#2

Why u still using strtok, use sscanf better
Reply
#3

You can use the tutorial from my signature for learning how to make commands...
Also use these tags:
PHP код:
[pawn]<-- CODE HERE -->[/pawn
Reply
#4

You didn't setplayerhealth anywhere in this script...
Reply
#5

Quote:
Originally Posted by CoaPsyFactor
Посмотреть сообщение
You didn't setplayerhealth anywhere in this script...
can you set it up for me in the code ?
Reply
#6

Quote:
Originally Posted by 10MIN
Посмотреть сообщение
You can use the tutorial from my signature for learning how to make commands...
Also use these tags:
PHP код:
[pawn]<-- CODE HERE -->[/pawn
Is this tags Working ? lemme test :
pawn Код:
lol maybe working ?
Reply
#7

@Houssem There are 4 tags for code: [code][html][php][pawn]
Reply
#8

Quote:
Originally Posted by 10MIN
Посмотреть сообщение
@Houssem There are 4 tags for code: [code][html][php][pawn]

can you please add setplauerhealeth in the cmd for me ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)