Little help. - 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: Little help. (
/showthread.php?tid=619361)
Little help. -
ThatFag - 16.10.2016
hello.
i was planing to start a bank robbery system but the thing is that i dont know how to make a such thing i want to.
The robbery will be counted on players - many players - less robbing time.
But the problem is that i dont know how to do this.
Can someone just give me an example of - more players - less time ?
simple as possible , ill do the other part
Re: Little help. -
DTV - 16.10.2016
If I'm reading this right, you want the time allowed to rob a bank to decrease when there are more robbers involved. What'd you do simply is make a variable that counts the number of robbers and then have it set the amount of time allowed to rob a bank depending on how many robbers there are.
pawn Код:
new BankRobbers; //this would be the global variable, basically just have this add up every time a robber joins and make sure to set it to 0 when a robbery is finished.
new RobTime; //this would also be a global variable to just act as what the robbery time will be
forward RobBank();
public RobBank() //just setting up an example public function to give you an idea of what I mean
{
switch(BankRobbers)
{
case 0..2: { RobTime = 5; }
case 3..5: { RobTime = 4; }
case 6..8: { RobTime = 3; }
default: { RobTime = 2; }
//this basically goes through the BankRobbers variable and checks what value it is and sets the RobTime to a determined value (in minutes)
}
//rest of the bank robbery code goes here
return 1;
}
I hope that isn't confusing, but gives you an idea on how to do what you asked (if I understood the question correctly).
Re: Little help. -
ThatFag - 17.10.2016
Okay im using this to count the players that are in same team (robbers)
Код:
new rCount = 0;
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][playerteam] != PlayerInfo[playerid][playerteam]) continue;
rCount++;
}
do i need to do it manually for every player counted.
for example.
Код:
if(rcount == 3) time will be 50 lets say
and if(rcount == 5) time will be 30
or there is a faster way to do
for example for every player take off 10 or 20 seconds