SA-MP Forums

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

Reply
 
Thread Tools Display Modes
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
Old 27/08/2017, 03:58 PM   #2
HoussemGaming
Banned
 
Join Date: Jun 2017
Location: France
Posts: 190
Reputation: 10
Default Re: what's wrong with this CMD

Why u still using strtok, use sscanf better
HoussemGaming is offline   Reply With Quote
Old 27/08/2017, 04:00 PM   #3
10MIN
Banned
 
Join Date: Jun 2017
Location: Clock4ever
Posts: 326
Reputation: 30
Default Re: what's wrong with this CMD

You can use the tutorial from my signature for learning how to make commands...
Also use these tags:
PHP Code:
[pawn]<-- CODE HERE -->[/pawn
10MIN is offline   Reply With Quote
Old 27/08/2017, 04:05 PM   #4
HoussemGaming
Banned
 
Join Date: Jun 2017
Location: France
Posts: 190
Reputation: 10
Default Re: what's wrong with this CMD

Quote:
Originally Posted by 10MIN View Post
You can use the tutorial from my signature for learning how to make commands...
Also use these tags:
PHP Code:
[pawn]<-- CODE HERE -->[/pawn
Is this tags Working ? lemme test :
pawn Code:
lol maybe working ?
HoussemGaming is offline   Reply With Quote
Old 27/08/2017, 04:04 PM   #5
CoaPsyFactor
Gangsta
 
Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 864
Reputation: 52
Default Re: what's wrong with this CMD

You didn't setplayerhealth anywhere in this script...
__________________
Quote:
Originally Posted by ThaiLuan View Post
Code:
C:\Users\Administrator\Downloads\Viet-RP\gamemodes\3mien.pwn(112016) : fatal error 101: cannot write to file: "disk full"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Help me! How to fix error
CoaPsyFactor is offline   Reply With Quote
Old 27/08/2017, 04:05 PM   #6
BadJih
Huge Clucker
 
BadJih's Avatar
 
Join Date: Aug 2017
Posts: 238
Reputation: 21
Default Re: what's wrong with this CMD

Quote:
Originally Posted by CoaPsyFactor View Post
You didn't setplayerhealth anywhere in this script...
can you set it up for me in the code ?
BadJih is offline   Reply With Quote
Old 27/08/2017, 04:10 PM   #7
10MIN
Banned
 
Join Date: Jun 2017
Location: Clock4ever
Posts: 326
Reputation: 30
Default Re: what's wrong with this CMD

@Houssem There are 4 tags for code: [code][html][php][pawn]
10MIN is offline   Reply With Quote
Old 27/08/2017, 04:13 PM   #8
BadJih
Huge Clucker
 
BadJih's Avatar
 
Join Date: Aug 2017
Posts: 238
Reputation: 21
Default Re: what's wrong with this CMD

Quote:
Originally Posted by 10MIN View Post
@Houssem There are 4 tags for code: [code][html][php][pawn]


can you please add setplauerhealeth in the cmd for me ?
BadJih is offline   Reply With Quote
Reply

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 01:04 AM.


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