Script Tutorial For A Score System Please
#1

Hi guys and girlies

I want to know if any of you know how to make a script where your money becomes your score?

That would really help

Thank You! ^^
Reply
#2

what do you mean like instead of getting money for doing something you get score?
Reply
#3

When you stunt, you get money, but I want the score to be the money
Reply
#4

you did not fully described what you need, so this thing might help you

https://sampforum.blast.hk/showthread.php?tid=207768
Reply
#5

when you do a stunt, you get money, right??

Now, when you have money. the score must always be set to the player's money

eg. a guys stunts, gets $100-his score will then be set to 100, he does another stunt, this time he gets $120- the score adds 120 on to it. Get what Imean?
Reply
#6

I don't think that's possible
Reply
#7

Quote:
Originally Posted by Steven Paul
Посмотреть сообщение
I don't think that's possible
It is possible.

Paste this above your scrtip, under the includes and defines:
pawn Код:
forward MoneyTimer(playerid);
Paste this in OnGameModeInit:
pawn Код:
SetTimer("MoneyTimer", 15000, true); // Each 15 seconds the score will be updated.
Paste this somewhere in your script:
pawn Код:
public MoneyTimer(playerid)
{
     new money = GetPlayerMoney(playerid);
     SetPlayerScore(playerid, money);
}
This will update each 15 second your score display and your money
will be shown at if you press tab for example. Anyways, i hope this
was were you was searching for..
Reply
#8

@Ihsan-Cingisiz

You code only works for playerid 0, you dont loop through all players

@Topic

The OnPlayerKeyStateChange version

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_ACTION) == KEY_ACTION) {
        for(newkeys = -1; (++newkeys) != MAX_PLAYERS; )
            SetPlayerScore(newkeys, GetPlayerMoney(newkeys));
    }
}
The only disadvantage is that OnPlayerKeyStateChange only works if the player is spawned which results in no update if you arent spawned
Reply
#9

Quote:

Quote:
Originally Posted by Steven Paul
I don't think that's possible
It is possible.

Paste this above your scrtip, under the includes and defines:
pawn Code:
forward MoneyTimer(playerid);

Paste this in OnGameModeInit:
pawn Code:
SetTimer("MoneyTimer", 15000, true); // Each 15 seconds the score will be updated.

Paste this somewhere in your script:
pawn Code:
public MoneyTimer(playerid)
{
new money = GetPlayerMoney(playerid);
SetPlayerScore(playerid, money);
}

This will update each 15 second your score display and your money
will be shown at if you press tab for example. Anyways, i hope this
was were you was searching for..

I'm Testing it now..
Reply
#10

for some reason, i'm not getting money when doing stunts... 0_o
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)