SA-MP Forums Archive
Somehthing is wrong.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Somehthing is wrong.. (/showthread.php?tid=182338)



Somehthing is wrong.. - Rocky Balboa - 10.10.2010

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 ?


Re: Somehthing is wrong.. - Ash. - 10.10.2010

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

[ pawn ] and [ /pawn] - without the spaces


Re: Somehthing is wrong.. - SampStunta - 10.10.2010

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


Re: Somehthing is wrong.. - Rocky Balboa - 10.10.2010

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. ...


Re: Somehthing is wrong.. - The_Moddler - 10.10.2010

Yep, I have the same problem.


Re: Somehthing is wrong.. - Austin - 10.10.2010

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


Re: Somehthing is wrong.. - Rocky Balboa - 10.10.2010

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


Re: Somehthing is wrong.. - The_Moddler - 10.10.2010

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;
}