why this is not working?
#1

i want to make the bail cash decrease 100$ each 1 second and doesn't work, what's the problem?

pawn Код:
SetTimerEx("UpdateBailSentence", 1000, true, "i", playerid);

public UpdateBailSentence(playerid)
{
    new string[128], bailsen;
    bailsen = PlayerInfo[playerid][pBailSentence] - 100;
    bailsen --;
    format(string, sizeof string, "Bail Sentence - $%i", bailsen);
    TextDrawSetString(JailList, string);
    TextDrawShowForPlayer(playerid, JailList);
    return 1;
}
Reply
#2

pawn Код:
SetTimerEx("UpdateBailSentence", 1000, true, "i", playerid);

public UpdateBailSentence(playerid)
{
    new string[128], bailsen, bailsens;
    bailsen = PlayerInfo[playerid][pBailSentence] - 100;//here you have defined the bailsen variable  to -100
    bailsens --;//and here you set the variable to - 1 , that's why its bugged, so let's try by another function it seems like you are trying to decrease the time -1 each one second to show as textdraws only
    format(string, sizeof string, "Bail Sentence - $%i", bailsens);
    TextDrawSetString(JailList, string);
    TextDrawShowForPlayer(playerid, JailList);
    return 1;
}
Reply
#3

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
pawn Код:
SetTimerEx("UpdateBailSentence", 1000, true, "i", playerid);

public UpdateBailSentence(playerid)
{
    new string[128], bailsen, bailsens;
    bailsen = PlayerInfo[playerid][pBailSentence] - 100;//here you have defined the bailsen variable  to -100
    bailsens --;//and here you set the variable to - 1 , that's why its bugged, so let's try by another function it seems like you are trying to decrease the time -1 each one second to show as textdraws only
    format(string, sizeof string, "Bail Sentence - $%i", bailsens);
    TextDrawSetString(JailList, string);
    TextDrawShowForPlayer(playerid, JailList);
    return 1;
}
bailsens will decrease the cash -1 each 1 sec, how to make the cash decrease -100 each 1 sec ?
Reply
#4

Are you trying to decrease the player money (givepayermoney) 100 each one second or that another script using new function ? if you're trying to make new function try that
pawn Код:
SetTimerEx("UpdateBailSentence", 1000, true, "i", playerid);

public UpdateBailSentence(playerid)
{
    new string[128], bailsens[20];
    PlayerInfo[playerid][pBailSentence] -= 100;
    format(string, sizeof string, "Bail Sentence - $%i", bailsens);
    TextDrawSetString(JailList, string);
    TextDrawShowForPlayer(playerid, JailList);
    return 1;
}
Reply
#5

worked, thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)