@script
int knives = getglobalvar("knives");
if (isempty(knives)){
knives = 30;
setglobalvar("knives",knives);
}
char text1 = "knives: " + knives;
drawstring(100, 100, 1, text1);
@end_script
script @script
void main()
{
int knives = getglobalvar("knives");
if (isempty(knives)){
knives = 30;
setglobalvar("knives",knives);
}
char text1 = "knives: " + knives;
drawstring(100, 100, 1, text1);
}
@end_script
if I put that code in the main of te update.c it works perfectly, does not blinks. but, the information is in the screen always. I want that hava same behavior that the player experience or lives or magic, that appears when the player enter in game and dissapears when the player leaves the game. I need repeat it for the four players.ty, but it continues blinking, lower but continues.
I did that the manual puts so I did not created a main function.
int knives = getglobalvar("knives");
if (isempty(knives)){
knives = 30;
setglobalvar("knives",knives);
}
I want that hava same behavior that the player experience or lives or magic, that appears when the player enter in game and dissapears when the player leaves the game. I need repeat it for the four players.![]()
if(openborvariant("in_level")==1){
void P1 = getplayerproperty(0, "entity");
void P2 = getplayerproperty(1, "entity");
void P3 = getplayerproperty(2, "entity");
void P4 = getplayerproperty(3, "entity");
if(P1){
// declare drawstring for player 1 here
}
if(P2){
// declare drawstring for player 2 here
}
if(P3){
// declare drawstring for player 3 here
}
if(P4){
// declare drawstring for player 4 here
}
}