can someone please help me with this?
-
#include "maps/mp/_utility";
#include "maps/mp/_hud_util";
#include "maps/mp/_createfx";init()
{
level thread OnPlayerConnected();
}OnPlayerConnected()
{
for(;;)
{
level waittill("connected", player);if (isDefined(player.pers["isBot"]) && player.pers["isBot"]) { continue; } player thread DisplayKillPoints(); }
}
DisplayKillPoints()
{
self endon ("disconnect");
level endon("game_ended");for(;;) { player waittill("killed_zombie"); if(player.killed_zombie_by_headshot) { createFx( "blood_splash_headshot", player.origin, player.angles, player ); createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+150"; hudSetElementText( player, "objective", "+150" ); } else { createFx( "blood_splash_zombie", player.origin, player.angles ); createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+100"; hudSetElementText( player, "objective", "+100" ); } }
}
-
it gives me an error in an unrelated line when i try to compile it and i don;t understand why
-
AutoTopGR the path of the included files isnt supposed to be a string thats why you probably get error in line 0 or do you get another error?
-
chicken emoji so i have to remove #symbol?
-
AutoTopGR what i mean is without the " so instead of
#include "maps/mp/_utility";
try
#include maps/mp/_utility;
-
chicken emoji thanks it fixed the compiling problem but when i try to start a zombies map i get these **** Unresolved external : "createfx" with 4 parameters in "main" at line 1 ****
**** Unresolved external : "createfontstring" with 5 parameters in "main" at lines 1,1 ****
**** Unresolved external : "hudsetelementtext" with 3 parameters in "main" at l any ideas? -
AutoTopGR To use createfontstring you have to include maps/mp/gametypes_zm/_hud_util. For hudsetelementtext i cant find a definition where do you have it from or did you make it yourself and what is it supposed to do?
-
chicken emoji i made it my self and it supposed to write in the center of the screen +100 if i kill a zombie and +150 if i kill it with headshot
-
AutoTopGR then you have to write the definition in this file or include the file that has the definitio
-
chicken emoji what do you mean when you say definition?
-
AutoTopGR The same thing you did with DisplayKillPoints is you define the function which is this part
DisplayKillPoints() { self endon ("disconnect"); level endon("game_ended"); for(;;) { player waittill("killed_zombie"); if(player.killed_zombie_by_headshot) { createFx( "blood_splash_headshot", player.origin, player.angles, player ); createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+150"; hudSetElementText( player, "objective", "+150" ); } else { createFx( "blood_splash_zombie", player.origin, player.angles ); createFontString( "objective", "hudsmall", 2.2, player.origin + (0,0,80), (1,1,0) ) + "+100"; hudSetElementText( player, "objective", "+100" ); } }
and then you execute it like this
player thread DisplayKillPoints();
with hudsetelementtext you try to execute it like this
hudSetElementText( player, "objective", "+100" );
but there is no definition like this
hudSetElementText(){ //Things this function is supposed to do }
also createFontString only uses 2 parameters which are font and scale so you should change it to createFontString( "objective", "hudsmall" );.
if you want to change the position or what it dispalys you can do this
killpointshud = createFontString( "objective", "hudsmall" );
instead of just
createFontString( "objective", "hudsmall" );
and then change the position of the hud element like this
killpointshud setpoint( "CENTER", "CENTER", 0, 0 );
or set what it displays using
killpointshud setText(text);
or
killpointshud setValue(value);
You should also change all the player in DisplayKillPoints to self because player is undefined in this context what i mean is for example change this
player waittill("killed_zombie");
to
self waittill("killed_zombie");
but only do this in the DisplayKillPoints function
-
AutoTopGR ChatGPT moment.