Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Grab Warning System By GoldZoro-GrabCnR");
- print("Grab IP: 62.141.35.14:7807");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print("Grab Warning System By GoldZoro-GrabCnR");
- print("Grab IP: 62.141.35.14:7807");
- print("----------------------------------\n");
- }
- #endif
- #define ROJO 0xFF0000FF
- #define AC 0xFF1493FF
- #define COLOR_RED 0xFF0000AA
- #define BLANCO 0xFFFFFFFF
- new WarnTimes[MAX_PLAYERS];
- public OnPlayerDisconnect(playerid, reason)
- {
- WarnTimes[playerid]=0;
- return 1;
- }
- command(warn, playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new i, reason[50];
- new name[50];
- new string[100];
- if(sscanf(params, "us[50]", i, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /warn [id] [reason]");
- else if(i == INVALID_PLAYER_ID) SendClientMessage(playerid, ROJO, "Player is not connected!");
- else
- {
- GetPlayerName(i, name, sizeof(name));
- if(playerid!=i)
- {
- if(WarnTimes[i]>=2)
- {
- format(string, 100,"[AUTO-KICK]: %s[%d] Has Been Kicked From The Server, [3/3 Warnings]", name, i);
- SendClientMessageToAll(AC, string);
- SetPlayerHealth(i, 999999999);
- SetPlayerInterior(i, 10);
- SetPlayerPos(i,226.9807,111.1730,999.0156);
- format(string, sizeof(string), "~W~You Have Been ~R~Kicked ~W~From The Server");
- GameTextForPlayer(i ,string, 99999999999999999999999, 3);
- Kick(i);
- }
- else
- {
- WarnTimes[i]+=1;
- if(WarnTimes[i]==1)
- {
- format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [1/3 Warnings]", reason);
- SendClientMessage(i, AC, string);
- }
- else if(WarnTimes[i]==2)
- {
- format(string, 256,"[ADMIN-WARN]: You Have Received A Warning, Reason: %s, [2/3 Warnings]", reason);
- SendClientMessage(i, AC, string);
- }
- format(string, 256,"[ADMIN-WARN]: %s[%d] Has Received A Warning, Reason: %s", name, i, reason);
- SendClientMessageToAll(AC, string);
- GameTextForPlayer(i,"~W~You Have Received A ~n~ ~R~Warning",5000,3);
- }
- }
- else SendClientMessage(playerid, COLOR_RED, "You Can't Warn Your Self");
- }
- }
- else SendClientMessage(playerid, COLOR_RED, "[Command Not Found Use /cmds or /commands.!]");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement