Can i use 2 function in 1 case ? - 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: Can i use 2 function in 1 case ? (
/showthread.php?tid=429768)
Can i use 2 function in 1 case ? -
M3mPHi$_S3 - 11.04.2013
PHP код:
case 15, 10: // this is original case but i cant use 2 funtion on it .
{
if(RaceStarted == 0)
{
RaceTime--;
if(JoinCount <= 0)
{
SendClientMessageToAll(RED, "[RACE]: New race \"%d\" is active!",RaceName);
}
}
case 20,25: // i created this other casue but did'nt work
{
if(joinCount <== 1)
{
RaceTime++;
new string[128];
format(string, sizeof(string), "[RACE]: Still \"%d\" seconds till \"%s\"race starts (/race)", CountAmount, RaceName);
SendClientMessageToAll(GREEN, string);
}
}
return CountAmount--;
}
Well i am using Ryder race system and i want to create some function This are codes So i want like At first if there are no palyer joining race it should give message like " Race is active " And dont start the count and the race untill 1 player join . So Ryder has use case system so how can i solve this i cant use it it gives me million of error. If this codes are wronge so help scipt and post to me.
Re: Can i use 2 function in 1 case ? -
MP2 - 11.04.2013
I don't understand your question, AT ALL. Give an example of what you're trying to do.
Re: Can i use 2 function in 1 case ? -
M3mPHi$_S3 - 11.04.2013
Well if you see in many server they have race system.
so when in my server a race is loaded so it auto keep sending this message
PHP код:
Still "%d" Second untill race start"
but i dont want this
i want it like at first when a race is loaded it should give message like " Race is active". it should not even start or give any kind of message untill 1 player join . If 1 player join then it should give message like " Still %d second until race start" else not ... Hope you understand
Re: Can i use 2 function in 1 case ? -
park4bmx - 11.04.2013
The
case that is inside the other
case will never get called as the first
case will will only be picked up when the amount is equaled to the first case.
So because of that that amount will stay the same for the seconds
case (the one inside) meaning it will not get called!
Solution ?
Simple, move the second case
outside and after the first one
But note the callback needs to be
re-called and value changed
Re: Can i use 2 function in 1 case ? -
M3mPHi$_S3 - 11.04.2013
Quote:
Originally Posted by park4bmx
The case that is inside the other case will never get called as the first case will will only be picked up when the amount is equaled to the first case.
So because of that that amount will stay the same for the seconds case (the one inside) meaning it will not get called!
Solution ?
Simple, move the second case outside and after the first one
But note the callback needs to be re-called and value changed
|
Alot of cases .. omg i am confused .. i will post you the link so cna you add it for me ? I just want a simple edit with my race system.