Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Copyright by G-Mac_x3
- Ihr dürft es nutzen und Verändern! Allerdings nicht als euer Eigenes ausgeben!
- */
- #include <a_samp>
- new Name[MAX_PLAYER_NAME];
- #define COLOR_GRAD3 0xCBCCCEFF
- #define COLOR_SYSTEM 0xEFEFF7AA
- new Text3D: afk;
- new string[128];
- #define Na SendClientMessage
- #define NaTl SendClientMessageToAll
- forward AfK_Init();
- forward AfK_Exit();
- new bool:AfK[MAX_PLAYERS];
- public AfK_Init()
- {
- print("AFK Include by G-Mac_x3 start");
- }
- public AfK_Exit()
- {
- print("AfK Include by G-Mac_x3 stopp");
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/afk",cmdtext,true) == 0)
- {
- if(AfK[playerid] == true)
- {
- Na(playerid, COLOR_SYSTEM, "Du bist bereits AfK");
- }
- else
- {
- GetPlayerName(playerid, Name, sizeof(Name));
- format(string, sizeof(string), "%s ist AfK!", Name);
- NaTl(COLOR_GRAD3, string);
- Na(playerid,COLOR_SYSTEM,"Du bist nun AFK. Nutze /back um wieder am Spiel Teilzunehmen");
- AfK[playerid] = true;
- TogglePlayerControllable(playerid, 0);
- afk = Create3DTextLabel("Spieler ist Abwesend",COLOR_GRAD3,0,0,0,20,playerid);
- GameTextForPlayer(playerid, "~r~Du bist AfK nutze /back um wieder spielen zu können.", 100, 3);
- }
- }
- if(strcmp("/back",cmdtext,true) == 0)
- {
- if(AfK[playerid] == true)
- {
- GetPlayerName(playerid, Name, sizeof(Name));
- format(string, sizeof(string), "%s ist aus dem AFK Modus zurück.", Name);
- NaTl(COLOR_GRAD3, string);
- Na(playerid,COLOR_SYSTEM,"Willkommen zurück");
- TogglePlayerControllable(playerid, 1);
- Delete3DTextLabel(afk);
- AfK[playerid] = false;
- }
- else
- {
- Na(playerid,COLOR_SYSTEM,"Du bist nich AfK");
- }
- }
- if(strcmp("/afkliste",cmdtext, true) == 0)
- {
- format(string, 256, "|Diese Spieler sind AfK|");
- Na(playerid,COLOR_SYSTEM,string);
- for(new s; s<MAX_PLAYERS; s++)
- {
- if(OnPlayerConnect(s))
- {
- if(AfK[s])
- {
- GetPlayerName(s,Name,sizeof(Name));
- format(string, 256, "- {FC8803}%s",string,Name);
- Na(playerid,COLOR_GRAD3,string);
- }
- }
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment