#1

Help me to make a COUNT of players that entered GAME / minigun I want to do it with textdraw example MINIGUN: 0 PLAYERS
Reply
#2

pawn Код:
new PlayersInMG = 0; // PlayersInMG will be your players count in minigun game and should be used in the textdraw

// In Command
CMD:minigun(playerid)
{

//When Player join minigun
PlayersInMG++; // This will increase count of the players who join the minigun game.
return 1;
}

//In exit Command
CMD:exitminigun(playerid)
{

//When player leave the minigun
PlayersInMG--; // This will decrease count of the players who join the minigun game.
return 1;
}

// You have to use PlayersInMG to Set the TextdrawString for Minigun players.
or you can use Iterator

pawn Код:
new Iterator:PlayerInMG<MAX_PLAYERS>;

// In Command
CMD:minigun(playerid)
{

//When Player join minigun
Iter_Add(PlayerInMG, playerid );
return 1;
}

//In exit Command
CMD:exitminigun(playerid)
{

//When player leave the minigun
Iter_Remove( PlayerInMG, playerid );
return 1;
}

// You have to use Iter_Count(PlayerInCNR); to Set the TextdrawString for Minigun players.
Reply
#3

new PlayersInMG = 0;

Textdraw1 = TextDrawCreate(503.000000, 113.000000, "--");
TextDrawBackgroundColor(Textdraw1, 65535);
TextDrawFont(Textdraw1, 3);
TextDrawLetterSize(Textdraw1, 0.390000, 1.000000);
TextDrawColor(Textdraw1, -65281);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);

forward DMcountUpdate ();
public DMcountUpdate ()
{

new string[256];
format(string, sizeof string, "~r~minigame: ~w~"%d", PlayersInMG);
TextDrawSetString(Textdraw1, string);
}
CMD:minigun(playerid)
{

//When Player join minigun
PlayersInMG++;
return 1;
}

//In exit Command
CMD:exitminigun(playerid)
{


PlayersInMG--;
return 1;
}
gamemoinit
SetTimer("DMcountUpdate", 1000, true);


hello, thank you for reponderme, so is the scrip right?
Reply
#4

Yes, it is.
Reply
#5

whare I can place
Quote:

Textdraw1 = TextDrawCreate(503.000000, 113.000000, "--");
TextDrawBackgroundColor(Textdraw1, 65535);
TextDrawFont(Textdraw1, 3);
TextDrawLetterSize(Textdraw1, 0.390000, 1.000000);
TextDrawColor(Textdraw1, -65281);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);

Reply
#6

Quote:
Originally Posted by GeorgeLimit
Посмотреть сообщение
whare I can place
Place the textdraw in OnGamemodeInit and show the textdraw in OnPlayerConnect.

pawn Код:
public OnGamemodeInit()
{
Textdraw1 = TextDrawCreate(503.000000, 113.000000, "--");
TextDrawBackgroundColor(Textdraw1, 65535);
TextDrawFont(Textdraw1, 3);
TextDrawLetterSize(Textdraw1, 0.390000, 1.000000);
TextDrawColor(Textdraw1, -65281);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
return 1;
}

public OnPlayerConnect(playerid)
{
 TextDrawShowForPlayer(playerid, Textdraw1);
 return 1;
}
Reply
#7

Quote:
Originally Posted by UFF
Посмотреть сообщение
Place the textdraw in OnGamemodeInit and show the textdraw in OnPlayerConnect.
error
pawn Код:
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(134) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(135) : warning 217: loose indentation
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(135) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(136) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(137) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(138) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(139) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(140) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(144) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
}
Reply
#8

Quote:
Originally Posted by GeorgeLimit
Посмотреть сообщение
error
pawn Код:
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(134) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(135) : warning 217: loose indentation
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(135) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(136) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(137) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(138) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(139) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(140) : error 017: undefined symbol "Textdraw1"
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(144) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
}
pawn Код:
new Text:Textdraw1;
Place this global at top.
Reply
#9

how about it?
Quote:

C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(136) : warning 217: loose indentation
C:\Users\Angga\Desktop\SAMP server\gamemodes\LAFR.pwn(143) : warning 217: loose indentation

Reply
#10

Quote:
Originally Posted by GeorgeLimit
Посмотреть сообщение
how about it?
Check this
https://sampforum.blast.hk/showthread.php?tid=256961
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)