Author Topic: Client-Sided Bounty System  (Read 637 times)

I'm trying to make a client-sided bounty system that credits hitmen for killing marked players while I'm on a City RP server. This would be interactive via the RTB messaging system, but I haven't found the two RTB functions that are called in receiving and sending private messages.

What and where are these 'two' functions?

Also, how can I get a list of players on a server, and their BLIDs, without using F2?

Thanks
« Last Edit: January 25, 2014, 02:41:57 PM by SpeedBlade »

To get all the players into a 'list' use this:
Code: [Select]
function getPlayerList()
{
for(%i=0;(%row=NPL_List.getrowtext(%i))!$="";%i++)
{
                //The names are placed on column number 1
%name = getField(%row,1);
if(%list$="")
%list = %name;
else
%list = %list TAB %name;
}
return %list;
}

Then to search the string made by that function use this:
Code: [Select]
function findField(%sourceString,%searchString,%offset)
{
%count = getFieldCount(%sourceString);
if(%offset > %count || %offset $= "")
%offset = 0;
for(%i=%offset;%i<%count;%i++)
{
%field = getField(%sourceString,%i);
if(%field $= %searchString)
return %i;
}
return -1;
}

Hope that helped and sorry for spoon feeding, I was bored..
Taken from this topic: http://forum.blockland.us/index.php?topic=211920.0

To get all the BL_IDs it would be similarly:
Code: [Select]
function getPlayerList()
{
for(%i=0;(%row=NPL_List.getrowtext(%i))!$="";%i++)
{
                //We use the 3rd column instead of the 1st
%name = getField(%row,3);
if(%list$="")
%list = %name;
else
%list = %list TAB %name;
}
return %list;
}

No idea about the RTB functions but I can try to dig up an add-on that used it IIRC

EDIT: I couldn't find it, does anyone remember that automatic voice mail thing for RTB?
« Last Edit: January 25, 2014, 04:29:40 PM by Aide33 »