PCS Game Hosting
 
  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 » Topic limit test
 View previous topic :: View next topic  
Author Message
Punisher
Administrator
Administrator


In Game: The Punisher
Gender: Gender:Male
Joined: May 04, 2012
Last Visit: Feb 04, 2019
Age: 21
Posts: 740

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

Status: Offline
PostPosted: Wed Apr 01, 2015 5:24 pm
PostPost subject: No icon Topic limit test
Reply with quote

SOF2MODDING Advanced tutorial – Adding Editable rank prefixes Part.1

In this tutorial im gonna show you how to make the rank prefixes editable, in for example your server config.
You should be a little bit familiar with the SDK of SOF2, setup successfully, and followed or atleast have something similar to Floo’s tutorial done.
I’ll be starting after the Tutorial of Floo by making the ranknames into a command line which you can edit in the server config.
I wont be using Images in this tutorial, only code example.

To Summerize Floo’s tutorial:
- Open g_cmd.c.
- Search G_SayTo by pressing ctrl + f in notepad and selecting the “ Search “ tab.
- When you did this you’ll probably see this:
/*
==================
G_SayTo
==================
*/

- Scroll down until you see:
else if ( ghost )
{
   type = "*ghost* ";
}
else if ( spec )
{
   type = "*spec* ";
}

- We will be duplicating this with the other ranks too:
else if ( ghost )
{
type = “^7*Ghost*”;
}
else if ( spec )
{
type = “^7*Spec*”;
}
else if ( ent->client->sess.modData->adminref == 2 )
{
type = “^7*Admin*”;
}
else if ( ent->client->sess.modData->adminref == 1 )
{
type = “^7*Referee*”;
}
else if ( ent->client->sess.modData->adminref == 3 )
{
type = “^7*Sysop*”;
}

else if ( ent->client )
{
type = “^7*Visitor*”;
}
else if ( ent->client->sess.modData->clan == 1 && ent->client->sess.modData->adminref <1>client->sess.modData->adminref == 2 )
{
type = “^7*Admin*”;
}

As you can see the type = “ Text ”; give you the text you see ingame.
This is the part we are going to edit.
Now use the commands you made, so in my case :

vmCvar_t pref_admin;
vmCvar_t pref_ref;
vmCvar_t pref_sysop;
vmCvar_t pref_coldr;
vmCvar_t pref_clan;
vmCvar_t pref_spec;
vmCvar_t pref_ghost;
vmCvar_t pref_visitor;


and add the commands instead of the “ text “.
So it’ll look something like this:

else if ( ent->client->sess.modData->adminref == 2 )
{
type = pref_admin.string;
}


Repeat it for the other ranks but with the other command names you made.
I ended up with this code:

else if ( ghost )
{
type = pref_ghost.string;
}
else if ( spec )
{
type = pref_spec.string;
}
else if ( ent->client->sess.modData->adminref == 2 )
{
type = pref_admin.string;
}
else if ( ent->client->sess.modData->adminref == 1 )
{
type = pref_ref.string;
}
else if ( ent->client->sess.modData->adminref == 3 )
{
type = pref_sysop.string;
}
else if ( ent->client->sess.modData->adminref == 4 )
{
type = pref_coldr.string;
}
else if ( ent->client )
{
type = pref_visitor.string;
}
else if ( ent->client->sess.modData->clan == 1 && ent->client->sess.modData->adminref <1>client->sess.modData->versionVerified )
{
chat = "achat";
}


Save the g_cmds.c and you are done.
Now you only have to compile it into a .qvm and copy/paste it into your vm folder.

If any errors occurred you probably misspelled a name or deleted a part of a code such as the “ ; “ at the end or didn’t use the same word as you used before.


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
Smiley face
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 How to make you own mod? 6 Crankedup 4488 Tue Jun 19, 2018 11:00 pm
Punisher View latest post
No new posts SOF2MAPPING Tutorial.2 - Make a room 0 Punisher 1993 Tue Oct 06, 2015 3:16 pm
Punisher View latest post
No new posts To make it more clear to everyone READ PLZ 3 Teo 3969 Thu Nov 28, 2013 8:41 pm
Teo View latest post
No new posts want to make a post :) 6 conviction 4803 Thu Nov 15, 2012 10:08 pm
Lessoe View latest post
No new posts Teo which programs u use for make themes? 1 MacTavishXx 3815 Wed May 02, 2012 5:23 pm
Teo View latest post
 




Back to Top

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

Copyright ©