Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Laisser les crédits pour le respect de l'auteur.
- #include <a_samp>
- #define COLOR_WHITE 0xFFFFFFFF
- new jAFK[MAX_PLAYERS];
- new Float:x, Float:y, Float:z;
- new Float:x2, Float:y2, Float:z2;
- new timer;
- new timer2;
- new etape;
- forward afkkick(playerid);
- forward afkrandom(playerid);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Système AFK par Jcvag44800");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/afk", cmdtext, true, 10) == 0)
- {
- new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(jAFK[playerid] == 0)
- {
- SendClientMessage(playerid,COLOR_WHITE,"Vous êtes AFK, pour vous enlever AFK, taper la commande /afk de nouveau.");
- jAFK[playerid] = 1;
- TogglePlayerControllable(playerid,0);
- format(string,sizeof string,"%s est maintenant AFK.",name);
- SendClientMessageToAll(COLOR_WHITE,string);
- PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);
- timer = SetTimer("afkkick", 1800000, false);//1800000
- timer2 = SetTimer("afkrandom", 0, false);
- return 1;
- }
- else
- {
- jAFK[playerid] = 0;
- TogglePlayerControllable(playerid,1);
- format(string,sizeof string,"%s n'est plus AFK.",name);
- SendClientMessageToAll(COLOR_WHITE,string);
- PlayerPlaySound(playerid,1098,0.0,0.0,0.0);
- KillTimer(timer);
- KillTimer(timer2);
- etape = 0;
- return 1;
- }
- }
- return 0;
- }
- public afkkick(playerid)
- {
- GetPlayerPos(playerid,x,y,z);
- GetPlayerPos(playerid,x2,y2,z2);
- if(x,y,z == x2,y2,z2)
- {
- SendClientMessage(playerid,COLOR_WHITE,"Vous avez été kické car vous êtes resté AFK pendant 30 minutes.");
- Kick(playerid);
- return 1;
- }
- return 1;
- }
- public afkrandom(playerid)
- {
- if(etape == 0)
- {
- SetPlayerPos(playerid,1424.1802,-948.6891,75.9765);
- SetPlayerCameraPos(playerid, 1416.4631,-926.6797,80.9006);
- SetPlayerCameraLookAt(playerid, 1414.4585,-863.2814,80.0632);
- etape ++;
- timer2 = SetTimer("afkrandom", 20000, false);
- }
- else if(etape == 1)
- {
- SetPlayerPos(playerid,1424.1802,-948.6891,75.9765);
- SetPlayerCameraPos(playerid, 1415.4370,-988.5178,104.9126);
- SetPlayerCameraLookAt(playerid, 1299.1265,-1087.5731,106.6301);
- etape ++;
- timer2 = SetTimer("afkrandom", 20000, false);
- }
- else if(etape == 2)
- {
- SetPlayerPos(playerid,691.0711,-1312.2938,103.4302);
- SetPlayerCameraPos(playerid, 637.2645,-1288.3374,128.4490);
- SetPlayerCameraLookAt(playerid, 702.7493,-1319.6592,126.6574);
- etape = 0;
- timer2 = SetTimer("afkrandom", 20000, false);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment