textrigger()
{
playernames = [];
trigger = getent("fin","targetname");
while (1)
{
trigger waittill ("trigger", user );
for(i=0;i<playernames.size;i++){
iprintlnbold (playernames);
if(user.name==playernames){
return;
}
}
iprintlnbold (user.name + " has finished the pcbouncer way!");
maps\mp\_utility::add_to_array(playernames, user.name);
iprintlnbold (playernames);
}
}
as you can see i was trying to make a trigger that displayed that you finished once... it doesnt work. any help much appreciated
what is wrong with my array :c
Moderator: Core Staff
-
- CJ Wannabe
- Posts: 42
- Joined: December 23rd, 2008, 5:14 pm
Re: what is wrong with my array :c
For one, that return; there will completely stop the function, so noone will be able to trigger your end trigger ever again.
Anyway there's a MUCH easier solution, you just set a variable for the player that finished, and only display your text when it's not set.
Like so:
Anyway there's a MUCH easier solution, you just set a variable for the player that finished, and only display your text when it's not set.
Like so:
Code: Select all
textrigger()
{
trigger = getent("fin","targetname");
while (1)
{
trigger waittill ("trigger", user );
if(!isdefined(user.finished)) iprintlnbold (user.name + " has finished the pcbouncer way!");
user.finished=true;
}
}
Ex CoD2 mapper/modder.
Re: what is wrong with my array :c
where did you get user.finished? is that a premade boolean? and can you still explain why it doesnt work... it never adds to the array and it wont let me print out that part of the array...
Re: what is wrong with my array :c
that explains, thank you very much. one more question, how to change color and font of text?
Re: what is wrong with my array :c
^1 - REDpcbouncer wrote:how to change color of text?
^2 - GREEN
^3 - YELLOW
^4 - BLUE
^5 - CYAN
^6 - PINK
^7 - WHITE
^0 - BLACK
- if you are using "iprintln/iprintlnblod" i think you can't change the fontpcbouncer wrote:how to change font of text?
- if you use an hud element :
ex: hud_name = NewHudElem();
change the font: hud_name.font = "objective"; hud_name.font = "default";
change the font scale: hud_name.fontscale = 1.2; hud_name.fontscale = 1.4;

Who is online
Users browsing this forum: No registered users and 3 guests