Fine Textdraw
#1

when I typed /pay, still add on. can I put it back to fine 0?

Код:
if(strcmp(cmdtext, "/pay", true) == 0)
    {
		new str[256];
        //TextDrawShowForPlayer(playerid, Fine);
        format(str, sizeof(str), "Fine : $%i", PlayerInfo[playerid][Fines]);
        PlayerInfo[playerid][Fines] = 0;
        TextDrawSetString(Fine, str);
        GivePlayerMoney(playerid, PlayerInfo[playerid][Fines]);
        return 1;
    }
Reply
#2

how do you know?
you debugged it ?
Reply
#3

pawn Код:
forward FineTimer(playerid);
public FineTimer(playerid)
{
  for(new i; i < MAX_PLAYERS; i ++)
  {
      if(IsPlayerConnected(i))
      {
         GetPlayerWantedLevel(playerid);
         {
             new str[256];
             TextDrawShowForPlayer(playerid, Fine);
             format(str, sizeof(str), "Fine: $%i", PlayerInfo[playerid][Fines]);
             TextDrawSetString(Fine, str);
             PlayerInfo[playerid][Fines] += 400;
         }
      }
  }
}
Reply
#4

by the looks of it.
you maybe don't kill the timer and it just keeps on setting the money to +400 ?

why is it a timer with the playerid passed on but then looping through them all again ?
its import that this timer is set up per a player(single TIME! only)
or just once globally with no variable pass onto it!

it don't make sense what your doing looping all players and adding 400 to the playerid of every connected player
Reply
#5

i type /pay 2 times and goes back to 0
Reply
#6

look, DEBUG the code!
its the only way, we cant tell what magic thing you have done...
i told you about the timer in the last reply.

there is obviously a reason for it working the 2nd time, but how do you know after 5 sec it would be 0 again ?
"you don't" so debug it

it will save everyone time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)