help with a command 1st attempt
#1

{
if (strcmp("/heal", cmdtext, true, 10) ==0)
{
if gTeam[playerid] = TEAM_COP;
{
SetPlayerHealth(playerid, 100);
SendPlayerMessage[playerid,COLOR_YELLOW, "you have cured cured (id: %d)");
}
if gTeam[playerid] = TEAM_COP;
SendClientMessage(playerid,COLOR_YELLOW, "only medics can heal people");
else if(gTeam[playerid] == TEAM_CIVILIAN)
SendClientMessage(playerid,COLOR_YELLOW), "only medics can heal players");
return 1;

}
}
i dont even know if i got the principle of it right please help
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(427) : warning 211: possibly unintended assignment
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(427) : error 001: expected token: "*then", but found ";"
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(427) : error 036: empty statement
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 017: undefined symbol "SendPlayerMessage"
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : warning 215: expression has no effect
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : warning 215: expression has no effect
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : warning 215: expression has no effect
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 029: invalid expression, assumed zero
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#2

pawn Код:
if gTeam[playerid] = TEAM_COP;
should be:
pawn Код:
if(gTeam[playerid] == TEAM_COP)
Reply
#3

Quote:
Originally Posted by Don Correlli
pawn Код:
if gTeam[playerid] = TEAM_COP;
should be:
pawn Код:
if(gTeam[playerid] == TEAM_COP)
thanks i noticed some other things i tried to change but nah i got
{
if(strcmp("/heal", cmdtext, true, 10) ==0)
{
427 if(gTeam[playerid] = TEAM_COP)
{
SetPlayerHealth(playerid, 100);
430 SendPlayerMessage[playerid,COLOR_YELLOW); "you have cured cured (id: %d)");
}
if(gTeam[playerid] = TEAM_COP)
SendClientMessage(playerid,COLOR_YELLOW); "only medics can heal people");
else if(gTeam[playerid] == TEAM_CIVILIAN)
SendClientMessage(playerid,COLOR_YELLOW); "only medics can heal players");
return 1;

}
}
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(427) : warning 211: possibly unintended assignment
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 017: undefined symbol "SendPlayerMessage"
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : warning 215: expression has no effect
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : warning 215: expression has no effect
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 029: invalid expression, assumed zero
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
LOL i changed it to team_medic not cop
Reply
#4

It's SendClientMessage, not SendPlayerMessage.
pawn Код:
SendPlayerMessage[playerid,COLOR_YELLOW); "you have cured cured (id: %d)");
should be:
pawn Код:
SendClientMessage(playerid, COLOR_YELLOW, "you have cured cured (id: %d)", playerid);
Reply
#5

Quote:
Originally Posted by Don Correlli
It's SendClientMessage, not SendPlayerMessage.
pawn Код:
SendPlayerMessage[playerid,COLOR_YELLOW); "you have cured cured (id: %d)");
should be:
pawn Код:
SendClientMessage(playerid, COLOR_YELLOW, "you have cured cured (id: %d)", playerid);
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(427) : warning 211: possibly unintended assignment
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 028: invalid subscript (not an array or too many subscripts): "SendClientMessage"
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : warning 215: expression has no effect
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : warning 215: expression has no effect
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : error 029: invalid expression, assumed zero
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(430) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
i now get themmessages looks like ima have to study it more
Reply
#6

I've edited some things and made it more readable. Test it, because I've not that gteam thing...
pawn Код:
{
    if(strcmp("/heal", cmdtext, true, 10) == 0) {
        if(gTeam[playerid] = TEAM_COP) {
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,COLOR_YELLOW, "you have cured cured (id: %d)");
         }
   
        if(gTeam[playerid] = TEAM_COP) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal people");
        }
       
        else if(gTeam[playerid] == TEAM_CIVILIAN) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal players");
            return 1;
        }
    }
}
And why do you said 2 times this: "if(gTeam[playerid] = TEAM_COP)"

Why don't you make it in one code?
Reply
#7

Quote:
Originally Posted by pascallj
I've edited some things and made it more readable. Test it, because I've not that gteam thing...
pawn Код:
{
    if(strcmp("/heal", cmdtext, true, 10) == 0) {
        if(gTeam[playerid] = TEAM_COP) {
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,COLOR_YELLOW, "you have cured cured (id: %d)");
         }
   
        if(gTeam[playerid] = TEAM_COP) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal people");
        }
       
        else if(gTeam[playerid] == TEAM_CIVILIAN) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal players");
            return 1;
        }
    }
}
And why do you said 2 times this: "if(gTeam[playerid] = TEAM_COP)"

Why don't you make it in one code?
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/heal", cmdtext, true, 10) == 0) {
421 if(gTeam[playerid] = TEAM_MEDIC) {
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid,COLOR_YELLOW, "you have been cured (id: %d)");
}

431 if(gTeam[playerid] = TEAM_COP) {
SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal other people");
}

else if(gTeam[playerid] == TEAM_CIVILIAN) {
SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal other players");
return 1;
}
}
440 }
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(426) : warning 211: possibly unintended assignment
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(431) : warning 211: possibly unintended assignment
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(440) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
But they work as a class e.g a cop is a cop and no other :/
Reply
#8

What do you mean? Sorry my English is very bad.

This is also needed:

pawn Код:
{
    if(strcmp("/heal", cmdtext, true, 10) == 0) {
        if(gTeam[playerid] = TEAM_MEDIC) {
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,COLOR_YELLOW, "you have cured cured (id: %d)");
            return 1;
        }

        if(gTeam[playerid] = TEAM_COP) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal people");
            return 1;

        }

        else if(gTeam[playerid] == TEAM_CIVILIAN) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal players");
            return 1;
        }
    }
}
And please past your code between this tags:
Код:
pawn Код:
Code here
Reply
#9

Quote:
Originally Posted by pascallj
What do you mean? Sorry my English is very bad.

This is also needed:

pawn Код:
{
    if(strcmp("/heal", cmdtext, true, 10) == 0) {
        if(gTeam[playerid] = TEAM_MEDIC) {
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,COLOR_YELLOW, "you have cured cured (id: %d)");
            return 1;
        }

        if(gTeam[playerid] = TEAM_COP) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal people");
            return 1;

        }

        else if(gTeam[playerid] == TEAM_CIVILIAN) {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal players");
            return 1;
        }
    }
}
And please past your code between this tags:
Код:
pawn Код:
{if(strcmp("/heal", cmdtext, true, 10) == 0) {line 423 if(gTeam[playerid] = TEAM_MEDIC) {SetPlayerHealth(playerid, 100);SendClientMessage(playerid,COLOR_YELLOW, "you have cured cured (id: %d)");return 1;}line 429 if(gTeam[playerid] = TEAM_COP) {SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal people");return 1;}else if(gTeam[playerid] == TEAM_CIVILIAN) {SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal players");return 1;}}line 440}
i added that under OnPlayerCommandText and get these errors
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(423) : warning 211: possibly unintended assignment
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(429) : warning 211: possibly unintended assignment
C:\Documents and Settings\matt\Desktop\SAMP LEARNING\gamemodes\learning.pwn(440) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Reply
#10

Try this:

pawn Код:
if(strcmp("/heal", cmdtext, true) == 0)
    {
        if(gTeam[playerid] == TEAM_MEDIC)
        {
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,COLOR_YELLOW, "you have cured cured (id: )");
            return 1;
        }

        else if(gTeam[playerid] == TEAM_COP)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal people");
            return 1;
        }

        else if(gTeam[playerid] == TEAM_CIVILIAN)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "only medics can heal players");
            return 1;
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)