Smiley face
 
  Forum Index    Search    Usergroups    Edit your profile    Members    Arcade    Ranks

 Reputation    Medals    Staff    Statistics    Board Rules    Forum FAQ    Private MessagesLogin, Check Messages    Log in 

Search for at
Soldier Of Fortune 2 Advanced Search



Post new topicReply to topicprinter-friendly viewThank Post
   Soldier Of Fortune 2 Forum Index » SOF2 Tutorials » prefix code tutorial by floo
 View previous topic :: View next topic  
Author Message
kingsfloo
Moderator
Moderator


Gender: Gender:Female
Joined: Jan 15, 2014
Last Visit: Jul 18, 2017
Age: 24
Posts: 57
Location: Argentina
Argentina.png 
Reputation: 328.3
votes: 1
Medals: 2 (View more...)
Modder (Amount: 1)

Status: Offline
PostPosted: Fri May 09, 2014 3:25 am
PostPost subject: No icon prefix code tutorial by floo
Reply with quote

how to add chat prefix names in the game (for request of punisher) by floo*

there is a little tutorial about what to do into the source to add the prefix names in the game for rocmod of gold

i`m talking to show your rang like this ** clan ** yourname ** referee ** whathever...etc....it`s not hard...

first at all u need to know there are many ways to add this im going to tell u (whoever u are) the most simple and obvious way to add this feature in your server mod...

i assume u already have the source code of this mod and also u know how to compile this....if u dont u can find some videos in youtube where someones teach u how to start....

ok lets start...

just see in the game the only who have a prefix are the spectators and the ghosts looking like this *spec* someone, *ghost*you....its what we want for all...then lets find where its deffined...

check g.cmds of the source exactly in this part G_SayTo

there is:

else if ( ghost )
{
    type = "*ghost* ";
}
else if ( spec )
{
    type = "*spec* ";
}

/*
then u just need to continue with the same structure just changing this part ( ghost ) .

-next step is find where are the definitions of the clan, visitors, admin, sysop. then lets find this, if u check more down in the same g.cmds u find this Cmd_AdminAdd_f and also how the others rang has ben added, there is the admin:

id_ent->client->sess.modData->adminref = 2; //obviusly we need to remove the id part

here is the referee (Cmd_RefereeMe_f):

ent->client->sess.modData->adminref = 1;

here is the sysop (Cmd_SysopAdd_f):

id_ent->client->sess.modData->adminref = 3; //same, without id

the visitors? they are just clients and this appear in multiple parts there is:

ent->client

(the clan?...ohhh its other thing....later i tell u...wait first lets add the admin, referee and sysop...)
*/

//continuing below the spec...add...

else if ( ent->client->sess.modData->adminref == 2 ) //we change ghost for  the admin def...
{
    type = "*Admin* "; // u can ofcourse change this admin name...u can recall the admins like *spongebob* if u want
}

else if ( ent->client->sess.modData->adminref == 1 ) //we change ghost for  the referee def...
{
    type = "*Referee* ";
}

else if ( ent->client->sess.modData->adminref == 3 ) //we change ghost for  the sysop def...
{
    type = "*Sysop* ";
}

else if ( ent->client ) //we change ghost for  the visitor -clients- def...
{
    type = "*Visitor* ";
}

else if ( ent->client->sess.modData->clan == 1 && ent->client->sess.modData->adminref < 1 ) //portion of code shared to me by pg mario...this need the extra thing about the adm in suspend
{
    type = "*Clan* ";
}

//========= thats all u have fun? enjoy! <3 Razz :F ================


then double click in the bat of the game copy past the new qvm in your vm server folder and thats all....

*note: i`m just a curious person about how the games work doing things Razz IM NOT A CODER (i just deduce these things for deduction and logic)...there are other ways how u can add this feature try to find your own way to add this!...just use your imagination...i just show u the easy way...actually im using other way how i find to add this to make more easy to change my prefix when i want ingame....

*note2: if someone who read this decide to use this a little "thanks" or a little credit is allways nice to know Smile....like i do when anyone help me in something

bye bye....

Floo*


Last edited by kingsfloo on Sat May 17, 2014 7:40 am; edited 2 times in total
Back to top
View user's profile Send private message
Sponsor
Punisher
Administrator
Administrator


In Game: The Punisher
Gender: Gender:Male
Joined: May 04, 2012
Last Visit: Jul 19, 2017
Age: 20
Posts: 714

Netherlands.png 
Reputation: 3138
votes: 3
Medals: 2 (View more...)
Dedication (Amount: 1)

Status: Offline
PostPosted: Fri May 09, 2014 2:10 pm
PostPost subject: No icon Re: prefix code tutorial by floo
Reply with quote

Thanks for Sharing this,
I've addes the link at the SOF2MODDING Topic: http://www.sof2.org/modules.php?name=Forums&file=viewtopic&p=2878


Website: House of Pain Server - Website
Serverlist: House of Pain Server - Serverlist

<a><img></a>

<a><img></a>
Back to top
View user's profile Send private message
kingsfloo
Moderator
Moderator


Gender: Gender:Female
Joined: Jan 15, 2014
Last Visit: Jul 18, 2017
Age: 24
Posts: 57
Location: Argentina
Argentina.png 
Reputation: 328.3
votes: 1
Medals: 2 (View more...)
Distinguished Uploader (Amount: 1)

Status: Offline
PostPosted: Sat May 17, 2014 7:42 am
PostPost subject: No icon Re: prefix code tutorial by floo
Reply with quote

no problem :)

just a detaill


*note3: this code like i show to u all...have a problem...if u type /adm suspend then u lose your admin prefix....admins in suspend in the prefix back to clan ....also rocmod have the problem of the "admin follow the enemy" then the big part of the servers have his admins in suspend cause the great part of the people think its a unfair advantage.....i let to u (who read this) to find the solution Razz ....love to show the big part of the solution but not the 100% ...muahahahahahhaahahah


[Watch On YouTube]
Back to top
View user's profile Send private message
Punisher
Administrator
Administrator


In Game: The Punisher
Gender: Gender:Male
Joined: May 04, 2012
Last Visit: Jul 19, 2017
Age: 20
Posts: 714

Netherlands.png 
Reputation: 3138
votes: 3
Medals: 2 (View more...)
Distinguished Uploader (Amount: 1)

Status: Offline
PostPosted: Sat May 17, 2014 3:24 pm
PostPost subject: No icon Re: prefix code tutorial by floo
Reply with quote

Solution:

Give everybody the oppurtunity to ghost their enemy, no suspend needed than because in scrims the follow enemy is disabled anyways.


Website: House of Pain Server - Website
Serverlist: House of Pain Server - Serverlist

<a><img></a>

<a><img></a>
Back to top
View user's profile Send private message
Sponsor
ProClanServers.com
kingsfloo
Moderator
Moderator


Gender: Gender:Female
Joined: Jan 15, 2014
Last Visit: Jul 18, 2017
Age: 24
Posts: 57
Location: Argentina
Argentina.png 
Reputation: 328.3
votes: 1
Medals: 2 (View more...)
Modder (Amount: 1)

Status: Offline
PostPosted: Sun May 18, 2014 4:17 am
PostPost subject: No icon Re: prefix code tutorial by floo
Reply with quote

or u can try to lock the prefix adding more deff in the code....or u can try to disable the function admin follow the enemy....

looooolz.....this video makes me laugh so much!...ro ridiculous and so funny :D


[Watch On YouTube]
Back to top
View user's profile Send private message
Punisher
Administrator
Administrator


In Game: The Punisher
Gender: Gender:Male
Joined: May 04, 2012
Last Visit: Jul 19, 2017
Age: 20
Posts: 714

Netherlands.png 
Reputation: 3138
votes: 3
Medals: 2 (View more...)
Dedication (Amount: 1)

Status: Offline
PostPosted: Sun May 18, 2014 3:40 pm
PostPost subject: No icon Re: prefix code tutorial by floo
Reply with quote

I'll take a look in the source after my final exams ( Tuesday at 17:00 +1 )


Website: House of Pain Server - Website
Serverlist: House of Pain Server - Serverlist

<a><img></a>

<a><img></a>
Back to top
View user's profile Send private message
Punisher
Administrator
Administrator


In Game: The Punisher
Gender: Gender:Male
Joined: May 04, 2012
Last Visit: Jul 19, 2017
Age: 20
Posts: 714

Netherlands.png 
Reputation: 3138
votes: 3
Medals: 2 (View more...)
Distinguished Uploader (Amount: 1)

Status: Offline
PostPosted: Tue May 27, 2014 1:59 pm
PostPost subject: No icon Re: prefix code tutorial by floo
Reply with quote

d_ent->client->sess.modData->adminref = 2; //obviusly we need to remove the id part
Should be
d_ent->client->sess.modData->adminref =;
as you say remove the id part, lol.

and /adm suspend is working properly for me.

When im Admin and i suspend my admin it goes to Soldier, when i press the button again im leader again.
same when i do suspend and than reconnect it gives me my admin back, and same when im sysop.

and could you also explain how to add a new rank such as Co-Leader.
I tried to figure it out myself by cloning the sysop codes and changing the 3 to 4 and changing sysop command to cldr, but didnt work. >.<


Website: House of Pain Server - Website
Serverlist: House of Pain Server - Serverlist

<a><img></a>

<a><img></a>
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic printer-friendly viewThank Post
Soldier Of Fortune 2 Forum Index »  SOF2 Tutorials
 
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts SOF2MAPPING Tutorial.2 - Make a room 0 Punisher 1011 Tue Oct 06, 2015 3:16 pm
Punisher View latest post
No new posts How to make you own mod? 4 Crankedup 2979 Fri Oct 02, 2015 6:38 pm
Teo View latest post
No new posts To make it more clear to everyone READ PLZ 3 Teo 2786 Thu Nov 28, 2013 8:41 pm
Teo View latest post
No new posts want to make a post :) 6 conviction 3506 Thu Nov 15, 2012 10:08 pm
Lessoe View latest post
No new posts Teo which programs u use for make themes? 1 MacTavishXx 2794 Wed May 02, 2012 5:23 pm
Teo View latest post
 




Back to Top

SOF2.ORG Multiplayer Community © 2017 All times are UTC + 2 Hours [DST enabled]
 

Copyright ©