AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TSRP Com (https://forums.alliedmods.net/showthread.php?t=41093)

keVn 07-09-2006 01:44

TSRP Com
 
Hey, anybody know a way to edit the COM to work with other jobs?
I've found where the script is

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
In HarbuRP_Talkarea.sma
But what do I change so that it works for another job other than MCPD

Jordan44053 07-09-2006 02:06

Re: TSRP Com
 
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.

Shurik3n 07-09-2006 02:14

Re: TSRP Com
 
Um...

Code:
select_string(id,"money","JobID","steamid",au thid,buffer)

You have au thid instead of authid, that will give you an error when you go to compile. What Jordan44053 said will fix the coms though.

Jordan44053 07-09-2006 02:16

Re: TSRP Com
 
Quote:

Edit2:

Remove the space from au thid, otherwise it won't work.
I had already edited it. :(

Shurik3n 07-09-2006 02:21

Re: TSRP Com
 
Oh, I guess when I got to this thread you hadn't edited it yet.

keVn 07-09-2006 02:24

Re: TSRP Com
 
Alright thanks!
Do you know of any flashbang mods or rope mod? =D

Shurik3n 07-09-2006 07:31

Re: TSRP Com
 
I think harbu's item mod has flash bangs in it already. As for a rope mod I am sure you can find something on these forums that would work, however porting it into harbu's item mod might take a little work.


All times are GMT -4. The time now is 07:59.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.