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[MAX_PLAYERS],Float:y[MAX_PLAYERS],Float:z[MAX_PLAYERS];
- 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;
- GetPlayerPos(playerid,x[playerid],y[playerid],z[playerid]);
- 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 = SetTimerEx("afkkick", 1800000,true, "i", playerid);
- timer2 = SetTimerEx("afkrandom", 3000,true, "i", playerid);
- 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;
- SetPlayerPos(playerid,x[playerid],y[playerid],z[playerid]);
- SetCameraBehindPlayer(playerid);
- return 1;
- }
- }
- if(strcmp("/test", cmdtext, true, 10) == 0)
- {
- new string[256];
- GetPlayerPos(playerid,x[playerid],y[playerid],z[playerid]);
- format(string,sizeof string,"Ancienne position: %4.1f %4.1f %4.1f",x,y,z);
- SendClientMessageToAll(COLOR_WHITE,string);
- return 1;
- }
- return 0;
- }
- public afkkick(playerid)
- {
- SendClientMessage(playerid,COLOR_WHITE,"Vous avez été kické car vous êtes resté AFK pendant 30 minutes.");
- Kick(playerid);
- 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 ++;
- }
- 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 ++;
- }
- 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;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment