SA-MP Forums Archive
Just wanted to ensure. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Just wanted to ensure. (/showthread.php?tid=362885)



Just wanted to ensure. - TaLhA XIV - 25.07.2012

PHP код:
{
    if (
strcmp("/heal"cmdtexttrue10) == 0)
        {
            if( 
PlayerInfo[playerid][TEAM_ME] )
            {
                    if(
GetPlayerSkin(playerid) == 274)
                    if(
GetPlayerSkin(playerid) == 275)
                    if(
GetPlayerSkin(playerid) == 276)
                    {
                            {
                                new 
targetid;
                                
SetPlayerHealth(targetid,100);
                            }
                    }
                    else
                    {
                        
SendClientMessage(playerid,0xE00404,"You are not a medicduty");
                    }
            }
            else
            {
                
SendClientMessage(playerid,0xE00404,"You are not a medic");
            }
          }
        } 
just wanted to ensure that would the script work fine?Like would it set the hp of the other person to 100?Just wanted to ensure.


Re: Just wanted to ensure. - Rudy_ - 25.07.2012

why don't you test it
it won't -.-
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 26 seconds.



Re: Just wanted to ensure. - Vince - 25.07.2012

Did you test it? No you didn't. Where is it supposed to get targetid? From thin air? Also your if-structure is flawed.
pawn Код:
new skin = GetPlayerSkin(playerid);
if(skin == 274 || skin == 275 || skin == 276)



Re: Just wanted to ensure. - TaLhA XIV - 25.07.2012

No I can't test this on my test server so was just asking to check if i am scripting it in the right way.


Re: Just wanted to ensure. - TaLhA XIV - 25.07.2012

sory for the double post but if you find me wrong so please correct me.


Re: Just wanted to ensure. - Devilxz97 - 26.07.2012

hmm . .

pawn Код:
{
    if (strcmp("/heal", cmdtext, true, 10) == 0)
        {
            new skin = GetPlayerSkin(playerid);
            if(GetPlayerTeam(playerid) == TEAM_ME)
            {
                if(skin == 274 || skin == 275 || skin == 276)
                    {
                            {
                                new targetid;
                                SetPlayerHealth(targetid,100);
                            }
                    }
                    else
                    {
                        SendClientMessage(playerid,0xE00404,"You are not a medicduty");
                    }
            }
            else
            {
                SendClientMessage(playerid,0xE00404,"You are not a medic");
            }
        }
    }