Somehthing is wrong..
#1

Look , on my OnPlayerDeath I have put many things like setplayerscore(playerid..or setplayerscore(killerid ... and some other variables like kills and deaths.. deaths[playerid]++; and kills[killerid]++..and if i put anything else underneath them .. nothing will work ... or if i put any code before thse lines , the score thingy wont work ... anyone could help me ?
Reply
#2

Show us your OnPlayerDeath code, in pawn tags...

[ pawn ] and [ /pawn] - without the spaces
Reply
#3

What have you tried to do?
Thinking of it I might make a tutorial of making different simple things like these...
Reply
#4

There it is,
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
   
    if(theclass[playerid] == Balla)
    {
        SetPlayerPos(playerid,657.9,1335.7,23.1);
    }
   
        Deaths[playerid]++;
        Kills[killerid]++;
        Score[playerid] -=1;
        Score[killerid] +=1;
        car[playerid] = 0;
        bike[playerid] = 0;
        SendDeathMessage(killerid,playerid,reason);

    return 1;
}
And if I put those variabes for scores and shit like that in front of hte other ones ,the "setplayerpos" doesn't work ....And if I do the opposite,the score thingy doesn't work. ...
Reply
#5

Yep, I have the same problem.
Reply
#6

What is "Balla" defined as? Also "theclass[playerid]" is that, new theclass[MAX_PLAYERS]?
Reply
#7

balla is defined as 1 .. you know #define Balla 1 and thelcas is new theclass[max_players]..
Reply
#8

You have to use this:

pawn Код:
if(IsPlayerConnected(killerid))
So:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid,playerid,reason);
    Deaths[playerid]++;
    Score[playerid] -=1;
    car[playerid] = 0;
    bike[playerid] = 0;
    if(theclass[playerid] == Balla)
    {
        SetPlayerPos(playerid,657.9,1335.7,23.1);
    }
    if(IsPlayerConnected(killerid))
    {
        Kills[killerid]++;
        Score[killerid]++;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)