SA-MP Forums Archive
HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP (/showthread.php?tid=661788)



HELP - nbx2000 - 15.12.2018

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


Re: HELP - UFF - 15.12.2018

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.



Re: HELP - nbx2000 - 15.12.2018

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?


Re: HELP - UFF - 16.12.2018

Yes, it is.


Re: HELP - GeorgeLimit - 16.12.2018

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);




Re: HELP - UFF - 16.12.2018

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;
}



Re: HELP - GeorgeLimit - 16.12.2018

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
}



Re: HELP - UFF - 16.12.2018

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.


Re: HELP - GeorgeLimit - 16.12.2018

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




Re: HELP - UFF - 16.12.2018

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