Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #define GREEN 4
- #define LIGHTGREEN 3
- #define DARKGREEN 5
- #define DEFAULT 1
- #define PREFIX "\x04[SurfTricks] \x01- \x03"
- public OnPluginStart()
- {
- RegConsoleCmd("specinfo", Command_SpecInfo);
- }
- public Action:Command_SpecInfo(client, args)
- {
- if (client == 0 || !IsClientInGame(client))
- {
- ReplyToCommand(client, "You must be in game to use this command");
- return Plugin_Handled;
- }
- if (!IsPlayerAlive(client))
- {
- PrintToChat(client, "%sDead people cannot have spectators !", PREFIX);
- return Plugin_Handled;
- }
- decl String:speclist[MAX_NAME_LENGTH*MAXPLAYERS+1];
- speclist[0] = '\0';
- for (new i = 1; i <= MaxClients; i++)
- {
- if (i == client || !IsClientInGame(i) || IsPlayerAlive(i))
- continue;
- Format(speclist, (sizeof(speclist)-strlen(speclist)), "%c%N%c, ", DARKGREEN, i, LIGHTGREEN);
- }
- if (speclist[0] == '\0')
- {
- PrintToChat(client, "%sNobody is speccing you!", PREFIX);
- }
- else
- {
- new lastchar = strlen(speclist)-2;
- if (speclist[lastchar] == ',')
- speclist[lastchar] = '\0';
- PrintToChat(client, "%sYou are being specced by %s%c!", PREFIX, speclist, LIGHTGREEN);
- }
- return Plugin_Handled;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement