CnR Minigame
#1

What's up? Searching for some code? ;s
Reply
#2

BUMP!
Reply
#3

Try to replace :

PlayerInfo[i][RobberyTimer] --;
by : PlayerInfo[i][RobberyTimer] ++;

i saw too that there is no space beteween PlayerInfo[i][RobberyTimer] and --;

it must be like that : PlayerInfo[i][RobberyTimer] --;

try that, if it doesn't work, try te replace -- by ++ (i cannot help more than that, cause it's your code not mine)
Reply
#4

Seriously? Do you want my robbing time to go above 20? -- = decrease it by 1. You're saying me to ++ 1 to that (facepalm)
Reply
#5

NEED HELP FFS
Reply
#6

pawn Код:
if(PlayerInfo[i][RobberyTimer] < 1 && PlayerInfo[i][pIsRobbing] == 1 && robbery[0])
            {
                PlayerInfo[i][RobberyTimer]--;
                format(string,sizeof(string),"Robbery in progress, Completing in %i seconds!",PlayerInfo[i][RobberyTimer]);
                GameTextForPlayer(i,string,3000,5);
            }
try to replace

pawn Код:
PlayerInfo[i][RobberyTimer]--;
by :

pawn Код:
PlayerInfo[i][RobberyTimer] =1;
and you'll see that it's work, because : PlayerInfo[i][RobberyTimer] is a variable, and when you do this :

pawn Код:
else if(PlayerInfo[i][RobberyTimer] == 1 && robbery[0])
            {
                new mrand = random(25000);
                PlayerInfo[i][RobberyTimer] = 0;
                PlayerInfo[i][pIsRobbing] = 0;
                format(string,sizeof(string),"[CNR] "GREEN"%s(%d) has robbed a total amount of $%i from San Fierro Train Station!",GetName(i),i,mrand);
                SendMessageToAllCnRPlayers(COLOR_SERVER,string);
                GivePlayerMoney(i,mrand);
                SetPlayerScore(i,GetPlayerScore(i)+2);
            }
it's checking if the variable = 1, if it's 1, it start the robbery.
Reply
#7

no not really, I'm using OneSecondVariable tick under ongamemodeinit(every second).
So, if PlayerInfo[i][RobberyTimer] == 1 then the robbery will end.
Check my /robshop command and compare it with my public
Reply
#8

man, try it, if it doesn't work, well try another thing
Reply
#9

checked. same problem
Reply
#10

Try changing
pawn Код:
if(PlayerInfo[i][RobberyTimer] < 1 && PlayerInfo[i][pIsRobbing] == 1 && robbery[0])
To:
pawn Код:
if(PlayerInfo[i][RobberyTimer] >= 1 && PlayerInfo[i][pIsRobbing] == 1 && robbery[0])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)