getplayerhealth help! lock pls
#1

So if we create something like this
Код:
if(strcmp(cmdtext, "/heal", true) == 0)
{
    new Float:health;
    GetPlayerHealth(playerid,health);
    if (health < 10.0)
    {
        SetPlayerHealth(playerid, 100.0);
    }
    return 1;
}
Why we need that ==0) after bracket,could someone explain pls?
Reply
#2

Its how long the cmdtext IS
Example "/heal" the 0 would turn into a 5 as it has 5 characters, But mostly you can use a 0 and still works
Reply
#3

oh thanks
got it
Reply
#4

No Prob Would be appreciated if i get +Rep
Reply
#5

The "==0" is there because if the strings match (cmdtext and "/heal") strcmp will return 0. So don't rep san1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)