Adding score
#1

Hi guys i cant add score on a robbery to a player pawno crashes idk why! heres my code
SetPlayerScore(playerid, ++1);
Ive tried this too:
SetPlayerScore(playerid,GetPlayerScore ++1);

both didnt work... CAn u guys help me please?
Reply
#2

SetPlayerScore(playerid, GetPlayerScore(killerid)+1);
Reply
#3

Quote:
Originally Posted by YanLanger
Посмотреть сообщение
SetPlayerScore(playerid, GetPlayerScore(killerid)+1);
killerid ?
Reply
#4

ah i thought he meants something else.. my fault sorry. lol
Reply
#5

Try this, just correcting YL's killerid mistake.

pawn Код:
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
Although, I don't think PAWNO should crash because of this. It mostly happens when there are more than 26 or 29 errors, somewhere near ...
Reply
#6

Try this.

pawn Код:
stock GivePlayerScore(playerid, score)
{
  if(playerid == INVALID_PLAYER_ID) return -1;
   new amount = GetPlayerScore(playerid);
   SetPlayerScore(playerid, amount+score);
   return 1;
}
If the player isn't connected "-1" is returned. Otherwise, 1 will be returned. Should work fine.
Reply
#7

Try this
Quote:

SetPlayerScore(playerid, GetPlayerScore(playerid)+1);

This if u want got score on kill

public OnPlayerDeath(playerid, killerid)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
return;1
}

Thanks before
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)