hello help me with Team Score Textdraw
#1

this showing me errors


Code
Код:
error 022: must be lvalue (non-constant)
 warning 215: expression has no effect
 warning 202: number of arguments does not match definition
 error 022: must be lvalue (non-constant)
 warning 215: expression has no effect
this is the code


error line 1476
pawn Код:
TEAM_ZOMBIE++; //Sets team1score
error line 1478
pawn Код:
GetPlayerScore(playerid, TEAM_ZOMBIE);
error line 1484
pawn Код:
TEAM_HUMAN++; //Sets team2score

pawn Код:
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    if(GetPlayerTeam(killerid) == 0)
    {
        TEAM_ZOMBIE++; //Sets team1score
        new newtext[41];
        GetPlayerScore(playerid, TEAM_ZOMBIE);
        format(newtext, sizeof(newtext), "ZOMBIE: %d",  TEAM_ZOMBIE);
        TextDrawSetString(Textdraw, newtext);
    }
    if(GetPlayerTeam(killerid) == 1)
    {
        TEAM_HUMAN++; //Sets team2score
        new newtext[41];
        format(newtext, sizeof(newtext), "HUMAN: %d", TEAM_HUMAN);
        TextDrawSetString(Textdraw1, newtext);
    }
Reply
#2

I take it TEAM_ZOMBIE and TEAM_HUMAN are just defines? If they are, you're not actually able to do what you're doing. Defines define a specific term to a value. What you want is a variable which you can change the values to:
pawn Код:
new TEAM_HUMAN_SCORE, TEAM_ZOMBIE_SCORE;
Then instead, do this:
pawn Код:
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    if(GetPlayerTeam(killerid) == 0)
    {
        TEAM_ZOMBIE_SCORE++; //Sets team1score
        new newtext[41];
        format(newtext, sizeof(newtext), "ZOMBIE: %d",  TEAM_ZOMBIE_SCORE);
        TextDrawSetString(Textdraw, newtext);
    }
    if(GetPlayerTeam(killerid) == 1)
    {
        TEAM_HUMAN_SCORE++; //Sets team2score
        new newtext[41];
        format(newtext, sizeof(newtext), "HUMAN: %d", TEAM_HUMAN_SCORE);
        TextDrawSetString(Textdraw1, newtext);
    }
Reply
#3

and now if you will able to define it and use new..

you can use also this i guess

Код:
if(GetPlayerTeam(killerid) == TEAM_BLABLA)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)