CnR Minigame - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CnR Minigame (
/showthread.php?tid=509033)
CnR Minigame -
biker122 - 25.04.2014
What's up? Searching for some code? ;s
Re: CnR Minigame -
biker122 - 25.04.2014
BUMP!
Re : CnR Minigame -
Ramoboss - 25.04.2014
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)
Re: CnR Minigame -
biker122 - 25.04.2014
Seriously? Do you want my robbing time to go above 20? -- = decrease it by 1. You're saying me to ++ 1 to that (facepalm)
Re: CnR Minigame -
biker122 - 25.04.2014
NEED HELP FFS
Re : CnR Minigame -
Ramoboss - 25.04.2014
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.
Re: CnR Minigame -
biker122 - 25.04.2014
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
Re : CnR Minigame -
Ramoboss - 25.04.2014
man, try it, if it doesn't work, well try another thing
Re: CnR Minigame -
biker122 - 25.04.2014
checked. same problem
Re: CnR Minigame -
awsomedude - 25.04.2014
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])