All pastes #1269951 Raw Edit

M][T's AFK script

public cpp v1 · immutable
#1269951 ·published 2008-11-29 03:00 UTC
rendered paste body
/*SCRIPTER PAR : MisterTRESPECTEZ LES DROIT D'AUTEUR----------------------------------------SCRIPTED BY / MisterTRESPECT THE COPYRIGHT *///include's#include <a_samp>//new'snew GodTimer;new InAfk[MAX_PLAYERS];new PlayerName2[MAX_PLAYER_NAME];new Float:PlayerHealth;//forward'sforward GodUpdate(i);//defined color's#define COLOR_GREEN 0x33AA33AA#define COLOR_RED 0xAA3333AA#define COLOR_PINK 0xFF66FFAA#define COLOR_BLUE 0x0000BBAA#define COLOR_LIGHTBLUE 0x33CCFFAA#define COLOR_ORANGE 0xFF9900AA#define COLOR_YELLOW 0xFFFF00AA#define COLOR_PURPLE 0x330066AA#define COLOR_GREY 0xCCCCCAA#define COLOR_WHITE 0xFFFFFFAA#define ANNOUNCEMENT 0x6AF7E1FFpublic OnFilterScriptInit(){	print("\n--------------------------------------");	print(" AFK script by MisterT v: 1.0a");	print("--------------------------------------\n");	return 1;}public OnPlayerCommandText(playerid, cmdtext[]){	if (strcmp("/afk", cmdtext, true) == 0)	{        new msg[128];		if(InAfk[playerid] == 1)		{		InAfk[playerid] = true;		SetPlayerPos(playerid, 2510.0857,-2656.6191,27.0000);		GetPlayerHealth(playerid, PlayerHealth);		GetPlayerName(playerid, PlayerName2, sizeof(PlayerName2));		format(msg,sizeof(msg)," %s Est desormait AFK", PlayerName(playerid));                SendClientMessageToAll(0xFFFFFFAA,msg);		format(msg, sizeof(msg), "%s:.:AFK:.:", PlayerName(playerid));		SetPlayerName(playerid, msg);		TogglePlayerControllable(playerid, false);		GodTimer = SetTimer("GodUpdate", 1000, true);		SendClientMessage(playerid, COLOR_YELLOW, "Vous êtes desormais AFK ");		}		return 1;	}	if (strcmp("/back", cmdtext, true) == 0)	{        new msg[128];		if(InAfk[playerid] == 0)		{		SetPlayerName(playerid,PlayerName2);		InAfk[playerid] = false;		format(msg,sizeof(msg)," %s Est revenu(e)", PlayerName(playerid));		TogglePlayerControllable(playerid, true);		SetPlayerPos(playerid, 1920.2896,-1402.0055,13.5703);		SetPlayerHealth(playerid, PlayerHealth);		KillTimer(GodTimer);                SendClientMessage(playerid, COLOR_YELLOW, "Vous êtes de retour ");		}		return 1;	}	return 0;}public OnPlayerText(playerid, text[]){	return 1;}public GodUpdate(i){	SetPlayerHealth(i, 100000);	return 1;}stock PlayerName(playerid){	new name[MAX_PLAYER_NAME];	GetPlayerName(playerid,name,sizeof(name));	return name;}