14.06.2011, 20:44
How do I "%i/i% PLAYERS" to appear after I have chosen with which skin to let me go. Once you choose which Civilian me spawn, then display "%i/i% PLAYERS"
Код:
#include <a_samp> #define SEC1 1000 #define SEC2 2000 #define SEC5 5000 new Text:PlayersOnServer; new string[16]; new MaxP; new totalon; public OnFilterScriptInit() { MaxP = GetMaxPlayers(); drawagain(); SetTimer("pOnline", SEC2, 1); return 1; } public OnFilterScriptExit() { for(new i=0; i<MAX_PLAYERS; i++) { TextDrawHideForPlayer(i, PlayersOnServer); } return 1; } forward drawagain(); public drawagain(){ if(PlayersOnServer){ TextDrawDestroy(PlayersOnServer); } format(string, sizeof(string), "%i/%i PLAYERS", totalon, MaxP); PlayersOnServer = TextDrawCreate(30,326, string); return 1; } forward pOnline(); public pOnline(){ totalon = 0; for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(totalon == 0){ totalon = 1; } else if (totalon > 0){ totalon++; } } } drawagain(); TextDrawFont(PlayersOnServer,2); TextDrawUseBox(PlayersOnServer,0); TextDrawColor(PlayersOnServer,0xFFFFFFFF); TextDrawAlignment(PlayersOnServer, 1); for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { TextDrawShowForPlayer(i, PlayersOnServer); } else { TextDrawHideForPlayer(i, PlayersOnServer); } } return 1; }