SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 27/08/2017, 03:55 PM   #1
BadJih
Huge Clucker
 
BadJih's Avatar
 
Join Date: Aug 2017
Posts: 238
Reputation: 21
Default what's wrong with this CMD

pawn Code:
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
BadJih is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
not sure what went wrong donhu789 Scripting Help 1 31/08/2016 04:22 PM
URL idk if wrong post or no if wrong sry YanLanger Everything and Nothing 10 05/10/2014 06:02 PM
Nothing is wrong but it sends wrong text? Guitar Scripting Help 1 21/08/2012 02:30 PM
showing wrong/wrong string TextDraws Voldemort Help Archive 5 22/02/2011 06:50 PM


All times are GMT. The time now is 12:32 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.