Junior Member
|
07-09-2006
, 02:06
Re: TSRP Com
|
#2
|
Quote:
// Intercom Messaging
public com_message(id,Speech[])
{
new JobID, buffer[64], authid[32]
get_user_authid(id,authid,31)
select_string(id,"money","JobID","steamid",au thid,buffer)
if(equali(buffer,"")) return PLUGIN_HANDLED
JobID = str_to_num(buffer)
if((JobID >= MCPDSTART && JobID <= MCPDEND) || (JobID >= MCMDSTART && JobID <= MCMDEND))
{
new players[32], num, authid2[32], buffer2[64], JobID2
get_players(players,num,"ac")
for(new i = 0; i < num;i++)
{
get_user_authid(players[i],authid2,31)
select_string(players[i],"money","JobID","steamid",authid2,buffer2 )
JobID2 = str_to_num(buffer2)
if((JobID2 >= MCPDSTART && JobID2 <= MCPDEND) || (JobID2 >= MCMDSTART && JobID2 <= MCMDEND)) client_print(players[i],print_chat,Speech)
}
}
else client_print(id,print_chat,"[TalkArea] Need to work for MCPD/MCMD to use Intercom^n")
return PLUGIN_HANDLED
|
The two parts in bold are what you'll need to change. The first is who can send a /com message, the second is who can receive it.
Say you wanted JobIDs 99-105 to be able to use the /com, too.
Quote:
// Intercom Messaging
public com_message(id,Speech[])
{
new JobID, buffer[64], authid[32]
get_user_authid(id,authid,31)
select_string(id,"money","JobID","steamid",au thid,buffer)
if(equali(buffer,"")) return PLUGIN_HANDLED
JobID = str_to_num(buffer)
if((JobID >= MCPDSTART && JobID <= MCPDEND) || (JobID >= MCMDSTART && JobID <= MCMDEND) || (JobID >= 99 && JobID <= 105))
{
new players[32], num, authid2[32], buffer2[64], JobID2
get_players(players,num,"ac")
for(new i = 0; i < num;i++)
{
get_user_authid(players[i],authid2,31)
select_string(players[i],"money","JobID","steamid",authid2,buffer2 )
JobID2 = str_to_num(buffer2)
if((JobID2 >= MCPDSTART && JobID2 <= MCPDEND) || (JobID2 >= MCMDSTART && JobID2 <= MCMDEND) || (JobID2 >= 99 && JobID2 <= 105)) client_print(players[i],print_chat,Speech)
}
}
else client_print(id,print_chat,"[TalkArea] Need to work for MCPD/MCMD to use Intercom^n")
return PLUGIN_HANDLED
|
You'd need to add what's in bold, and edit it to do what you want. You can add more than one.
Quote:
if((JobID2 >= MCPDSTART && JobID2 <= MCPDEND) || (JobID2 >= MCMDSTART && JobID2 <= MCMDEND) || (JobID2 >= 99 && JobID2 <= 105) || (JobID2 >= 512 && JobID2 <= 519) || (JobID2 >= 931 && JobID2 <= 952))
|
Make sure to add the same ones to the first if, too, so that the JobIDs can send as well as receive.
Tell me if this is too complicated, I'm somewhat used to this stuff.
Edit:
Quote:
// Intercom Messaging
public com_message(id,Speech[])
{
new JobID, buffer[64], authid[32]
get_user_authid(id,authid,31)
select_string(id,"money","JobID","steamid",au thid,buffer)
if(equali(buffer,"")) return PLUGIN_HANDLED
JobID = str_to_num(buffer)
if((JobID >= MCPDSTART && JobID <= MCPDEND) || (JobID >= MCMDSTART && JobID <= MCMDEND))
{
new players[32], num, authid2[32], buffer2[64], JobID2
get_players(players,num,"ac")
for(new i = 0; i < num;i++)
{
get_user_authid(players[i],authid2,31)
select_string(players[i],"money","JobID","steamid",authid2,buffer2 )
JobID2 = str_to_num(buffer2)
if((JobID2 >= MCPDSTART && JobID2 <= MCPDEND) || (JobID2 >= MCMDSTART && JobID2 <= MCMDEND)) client_print(players[i],print_chat,Speech)
}
}
else client_print(id,print_chat,"[TalkArea] Need to work for MCPD/MCMD to use Intercom^n")
return PLUGIN_HANDLED
|
You may want to change that, too.
Edit2:
Remove the space from au thid, otherwise it won't work.
__________________
Last edited by Jordan44053; 07-09-2006 at 02:14.
|
|