is there a way to shorten this?
#10

Quote:
Originally Posted by Kitten
Посмотреть сообщение
got a problem here why isnt this working this when other team that is not a medic it says unknown command

pawn Код:
new
    index,
    cmd[20];
    cmd = strtok(cmdtext, index);
    if (strcmp(cmd, "/healhim", true) == 0)
    if(cTeam[playerid] == TEAM_MEDIC)
    if(cTeam[playerid] != TEAM_MEDIC) SendClientMessage(playerid,COLOR_WHITE,"You are not a medic!");
    else
    {
        new
        tmp[20],
        id;
        tmp = strtok(cmdtext, index);
        if (strlen(tmp))
        {
            id = strval(tmp);
            if (IsPlayerConnected(id))
            {
                SetPlayerHealth(id, 100.0);
                SendClientMessage(id, 0x00FF00AA, "You have been healed by a Medic Survivor");
                SendClientMessage(playerid, 0x00FF00AA, "You Have Healed The player");
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000AA, "Player not found");
            }
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
        }
        return 1;
        }
Someone correct me if i am wrong, but you put
pawn Код:
if(cTeam[playerid] != TEAM_MEDIC) SendClientMessage(playerid,COLOR_WHITE,"You are not a medic!")
in the wrong place..

Supposed to be like
pawn Код:
{
else if(cTeam[playerid] != TEAM_MEDIC) SendClientMessage(playerid,COLOR_WHITE,"You are not a medic!");
}
Excuse the sloppy identation
Reply


Messages In This Thread
is there a way to shorten this? - by Kitten - 16.10.2010, 23:15
Re: is there a way to shorten this? - by MBX97 - 16.10.2010, 23:18
Re: is there a way to shorten this? - by Las Venturas CNR - 16.10.2010, 23:18
Re: is there a way to shorten this? - by Kitten - 16.10.2010, 23:20
Re: is there a way to shorten this? - by JaTochNietDan - 16.10.2010, 23:21
Re: is there a way to shorten this? - by Las Venturas CNR - 16.10.2010, 23:22
Re: is there a way to shorten this? - by Kitten - 16.10.2010, 23:23
Re: is there a way to shorten this? - by Kitten - 16.10.2010, 23:36
Re: is there a way to shorten this? - by JaTochNietDan - 16.10.2010, 23:38
Re: is there a way to shorten this? - by Ritchie999 - 16.10.2010, 23:39

Forum Jump:


Users browsing this thread: 4 Guest(s)