#1

hi there could someone help me with the score so it dosent register kill it dose money a little help thx for ur time



Also could you help me with this http://forum.sa-mp.com/index.php?topic=111987.0
Reply
#2

Quote:
Originally Posted by sggassasin
hi there could someone help me with the score so it dosent register kill it dose money a little help thx for ur time



Also could you help me with this http://forum.sa-mp.com/index.php?topic=111987.0
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  SendDeathMessage(killerid, playerid, reason);
  GivePlayerMoney(killerid, 5000);
  return 1;
}
Reply
#3

i dont whant to give player money i whant it to when you check the score such as tab insted of showing up howmany kill you got it showes how much money you got
Reply
#4

new playermoney

playermoney = GetPlayerMoney(playerid)

OnPlayerConnect

SetPlayerScore(playerid, playermoney);
Reply
#5

Quote:
Originally Posted by ekeleke
new playermoney

playermoney = GetPlayerMoney(playerid)

OnPlayerConnect

SetPlayerScore(playerid, playermoney);
This will work, but in a very limited way. During the course of the game the player is likely to gain/lose money, and this will not compensate for that. You need to use a timer that goes off at regular intervals.

pawn Код:
#include <a_samp>

forward MoneyCheck();
#define PERIOD 5000 //Time in ms between each score update. Low = laggy, High = bigger waits between updates

public OnGameModeInit()
{
    SetTimer("MoneyCheck", PERIOD, 1);
    return 1;
}

public MoneyCheck()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        SetPlayerScore(i,GetPlayerMoney(i));
      }
    }
}
Reply
#6

or

if he does somethin g

with /buydrugs

or anythiong in that way

for eample

if(strcmd,"/buydrugs", blablabla

SendClientMessage(playerid, 0xAA3333AA,"You have bought some drugs");
GivePlayerMoney(playerid, -1000);
SetPlayerScore(playerid, playermoney
Reply
#7

@ekeleke: That's all well and good, but there are little things like stunt bonuses, and the amount you get taken off you when you die that you can't detect without a timer.
Reply
#8

You can put SetPlayerScore(playerid, playermoney);

under onplayerdeath

and he can disable stunt bonuses because i don't think he has a stunt server

but a timer is ok

but if he is a beginning scripter he will understand SetPlayerScore better
Reply
#9

Quote:
Originally Posted by sggassasin
hi there could someone help me with the score so it dosent register kill it dose money a little help thx for ur time



Also could you help me with this http://forum.sa-mp.com/index.php?topic=111987.0
The guy specificly asks how to give money instead of a point when there is a kill and when i show he him he said he did not want to know how to give money? Funny thats exactly what he asked for.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)