/roll system 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: /roll system help (
/showthread.php?tid=603401)
/roll system help -
XtremeRz - 22.03.2016
Well, I need help scripting a /roll system, variables gonna be used (number = random(10), difficulty, msg),
Number is the number gonna show from 10, like 4-10 or 7-10. Difficulty is the difficulty used, If the number passed the difficulty, It will the players around him that he succeeded, and if it's lower then he failed.
Код:
CMD:roll(playerid,params[])
{
new name[26],number = random(10),difficulty,msg1[61],msg2[61],msg3[61];
GetPlayerName(playerid,name,sizeof(name));
format(msg1,sizeof(msg1),"((%s(ID: %d) has rolled at difficulty %i (%i-10) Succeed-)",name,playerid,difficulty,number);
format(msg2,sizeof(msg2),"((%s(ID: %d) has rolled at difficulty %i (%i-10)-Failed-)",name,playerid,difficulty,number);
format(msg3,sizeof(msg3),"((%s(ID: %d) has rolled at difficulty %i (%i-10)-BOTCHED-)",name,playerid,difficulty,number);
if(number >= difficulty)
{
SendClientMessage(playerid,COLOR_GREY,msg1);
}
else if(number < difficulty);
{
SendClientMessage(playerid,COLOR_GREY,msg2);
}
return 1;
}
But the thing im stuck in, is.. when the number is 2 or lower, and the difficulty is 6 or higher.
And, when the number is 3 or lower, and the difficulty is 8 or higher.
He gets a msg saying with red that he "BOTCHED"..
Which means, in both cases, diff is 6+ number is 2- / diff is 8+ number is 3-
He gets the BOTCH msg.
I wonder how can i do that?
Re: /roll system help -
XtremeRz - 22.03.2016
Bump