SA-MP Forums Archive
[FilterScript] Random Hit/Mission System - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Random Hit/Mission System (/showthread.php?tid=632040)



Random Hit/Mission System - NealPeteros - 08.04.2017

Random Hit/Mission System
________________________________________________
Random Hit/Mission System is a Filterscript made for any type of gamemode, may be a Freeroam, Cops 'n Robbers, Team Deathmatch, Deathmatch, etcetera etcetera. It features a random connected player to be assigned as the "hit" and the mission is to kill him. The killer gains a prize of a random bounty of or below $500,000 which is editable through finding #define BOUNTYMONEY. The random hit can be started by a RCON Administrator, also editable to your own administrative enumerator, through /startnewhit. After using this command, a 2 minute wait is given then the hit is assigned to a random player. It is a simple system and, I bet, is a user-friendly code.

Usage Instructions
  1. Login as an RCON Administrator
  2. Use /startnewhit to start the 2 minute wait
  3. After the 2 minute wait, a random player should be assigned as the random hit
  4. Kill the hit to earn your very own prize
Media and Photos
/startnewhit is called, the 2 minute wait starts

After 2 minutes, a random player is picked as the "hit"


Credits Download Access
PASTEBIN



Re: Random Hit/Mission System - NealPeteros - 08.04.2017

Editted


Re: Random Hit/Mission System - Electron123 - 08.04.2017

Can I use it in my freeroam server?


Re: Random Hit/Mission System - NealPeteros - 08.04.2017

Quote:
Originally Posted by Electron123
View Post
Can I use it in my freeroam server?
Yeah, sure. Asking for permission of usage wouldn't be necessary. The script's all yours


Re: Random Hit/Mission System - Bolex_ - 08.04.2017

All this publics you're have there and you're not using it are unnecessary! Also use GetPlayerPoolSize instead

All these could be made in one line

Code:
new connectedids[MAX_PLAYERS];
new onlineplayers;
new playername[MAX_PLAYER_NAME+5];
 
new hiton = -1;
 
new recenthit = 0;
 
new bounty;
new bonus;



Re: Random Hit/Mission System - NealPeteros - 08.04.2017

Quote:
Originally Posted by Bolex_
View Post
All this publics you're have there and you're not using it are unnecessary! Also use GetPlayerPoolSize instead

All these could be made in one line

Code:
new connectedids[MAX_PLAYERS];
new onlineplayers;
new playername[MAX_PLAYER_NAME+5];
 
new hiton = -1;
 
new recenthit = 0;
 
new bounty;
new bonus;
Edited, sorry bout that, haven't got the time.


Re: Random Hit/Mission System - Eatos - 11.04.2017

I'm trying to use this great filterscript in SATDM but I can't get it to work.
Whenever I type the command in order to start a new random hit, nothing comes up.
I've simply commented the unnecessary lines but still, I don't know what's wrong.
PasteBin
(I'm a complete noob btw)


Re: Random Hit/Mission System - NealPeteros - 11.04.2017

Hey, I tried debugging your script, especially the code of the command, and here's the funny thing. When I almost lost all hope, I realized there was one more thing I didn't try yet, and I didn't notice, and that was to try to un-comment the "unnecessary" lines you commented, turns out they were "necessary". Never comment those lines, they're completely necessary for either a filterscript or a gamemode.
Pastebin


Re: Random Hit/Mission System - Eatos - 11.04.2017

Quote:
Originally Posted by NealPeteros
View Post
Hey, I tried debugging your script, especially the code of the command, and here's the funny thing. When I almost lost all hope, I realized there was one more thing I didn't try yet, and I didn't notice, and that was to try to un-comment the "unnecessary" lines you commented, turns out they were "necessary". Never comment those lines, they're completely necessary for either a filterscript or a gamemode.
Pastebin
Thanks.
I tried debugging the script as well (actually, that's what I'm doing right now) and noticed that the code never enters the if condition that requires "recenthit" to be equal or great than 1, because recenthit never changes (it is always equal to 0).
Am I wrong?

EDIT: Got it to work. Thanks!


Re: Random Hit/Mission System - NealPeteros - 11.04.2017

Quote:
Originally Posted by Eatos
View Post
the code never enters the if condition that requires "recenthit" to be equal or great than 1, because recenthit never changes (it is always equal to 0).
Absolutely, should've changed that. Oh well.