Time, date ?
Moderators: Forum moderators, developers
Time, date ?
Hello , i need a code to let the player show the time and date.
can someone help ?
can someone help ?
Re: Time, date ?
look at the /currenttime command that already exists in ET (src/cgame/cg_consolecommands.c)dutchmeat wrote:Hello , i need a code to let the player show the time and date.
can someone help ?
send lawyers, guns and money
Re: Time, date ?
Yes ET, i code in rtcw demo... :OSCDS_reyalP wrote:look at the /currenttime command that already exists in ET (src/cgame/cg_consolecommands.c)dutchmeat wrote:Hello , i need a code to let the player show the time and date.
can someone help ?
but tnx
Re: Time, date ?
So why do you ask in the ET Modding forum?dutchmeat wrote: Yes ET, i code in rtcw demo... :O
- =FF=im2good4u
- Posts: 3821
- Joined: Wed Feb 05, 2003 7:30 am
- Location: The Netherlands, HOLLAND
- Contact:
yeh he got u there
<a href="http://bunnyherolabs.com/adopt/showpet. ... dQ=="><img src="http://petimage.bunnyherolabs.com/adopt ... Q0dQ==.png" width="80" height="100" border="0"></a>
Can someone help me out HERE? :S :
this code is in g_combat.c and it does this:
when you hit someone with a bullet (either an enemy , chair or something else) you will get health!...
Code: Select all
// Vampire mod
if (g_vampire.integer) {
attacker->health = attacker->health + take;
if (attacker->health > 500) {
attacker->health = 500;
}
}
// end Vampire
just the same as above but it can only be used with KNIFE , so when i have a knife and g_vampire is enabled, i will get health when i stab someone.
can someone help ? tnx
Re: Time, date ?
Huh ? there is no public SDK for the RTCW demo, and the EULA restricts making mods for it AFAIK. Secondly, you could still just copy the code from ET. It should work fine as /currenttime was added by OSP for RTCW.dutchmeat wrote: Yes ET, i code in rtcw demo... :O
but tnx
In the second question, look at the mod parameter. MOD is Means Of Death.
send lawyers, guns and money
yes i already copied the et code... had to change it a little bit though :
but about the vampire:
you dont get health when you KILL someone, you get health when you shoot at someone... but thats now with all weapons, for every bulet (rocket,nade...etc) you get health.. and i want it only for KNIFE.
Code: Select all
/*
=================
Cmd_currenTime_f
=================
*/
const char *aMonths[12] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
void Cmd_currentTime_f( gentity_t *ent ) {
qtime_t ct;
trap_RealTime(&ct);
G_Printf( "Current time: ^3%02d:%02d:%02d (%02d %s %d)\n", ct.tm_hour, ct.tm_min, ct.tm_sec, ct.tm_mday, aMonths[ct.tm_mon], 1900+ct.tm_year );
}
you dont get health when you KILL someone, you get health when you shoot at someone... but thats now with all weapons, for every bulet (rocket,nade...etc) you get health.. and i want it only for KNIFE.
I told you *exactly* what you needed to check, assuming your vampire stuff is in G_Damage (which is the logical place to put it)dutchmeat wrote:and i want it only for KNIFE.
the mod parameter tells you what weapon was used to inflict the damage. if you look through G_Damage, you should be able to see other weapon specific checks.
send lawyers, guns and money
finaly i did it
took me a while because of other weapons could also get that health
Code: Select all
// Vampire mod
if (g_vampire.integer){
if(attacker->s.weapon == WP_KNIFE){
attacker->health = attacker->health + take;
if (attacker->health > 500) {
attacker->health = 500;
}
}
}
// end Vampire
took me a while because of other weapons could also get that health