Й Um Sisteminha Muinto Simples de /ausentar e /voltar por exemplo eu digito /ausentar eu vou para um interior de um local dai qundo eu digito /voltar eu volto para aquela posiзгo anterior eu sei que nao e grande coisa mas foi o primeiro sistema que eu fiz .
ah esqueci a base do sistema foi feita por clandestino e eu dei uma breve e grande arrumada
pawn Код:
#include <a_samp>
// •~ Bizu ~•
//Sistema AFK
new AFK[MAX_PLAYERS]
new Text:AfkText;
new Text:AfkBackText;
#define COLOR_MARINHO 0xACF6AFAA
#define COLOR_PASTEL 0xF2B744AA
#define COLOR_GBOM 0xE2E7F6AA
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock PlayerName(playerid) {
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}
public OnFilterScriptInit()
{
print("\n* Ideia De Clandestino e Bizu Modifico \n"); // =D
return 1;
}
public OnFilterScriptExit()
{
print("\n* Ideia De Clandestino e Bizu Modifico \n"); // =(
return 1;
}
public OnPlayerConnect(playerid)
{
AFK[playerid]=0;
}
public OnPlayerDisconnect(playerid, reason)
{
AFK[playerid]=0;
TextDrawHideForPlayer(playerid,Text:AfkText);
TextDrawHideForPlayer(playerid,Text:AfkBackText);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/ausentar", true) == 0)
{
if(AFK[playerid]==0)
{
new string[256];
AFK[playerid]=1;
SetPlayerVirtualWorld(playerid, 1);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
TextDrawShowForPlayer(playerid,AfkText);
TextDrawShowForPlayer(playerid,AfkBackText);
GetPlayerName(playerid, PlayerName(playerid), MAX_PLAYER_NAME);
format(string, sizeof(string), "%s se ausentou (/ausentar)", PlayerName(playerid));
SendClientMessageToAll(COLOR_MARINHO, string);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Vocк jб estб ausente.");
return 1;
}
return 1;
}
if (strcmp(cmdtext, "/voltar", true) == 0)
{
if(AFK[playerid]==1)
{
new string[256];
AFK[playerid]=0;
SetPlayerVirtualWorld(playerid, 0);
//SpawnPlayer(playerid);
TogglePlayerControllable(playerid,1);
TextDrawHideForPlayer(playerid,AfkText);
TextDrawHideForPlayer(playerid,AfkBackText);
GetPlayerName(playerid, PlayerName(playerid), MAX_PLAYER_NAME);
format(string, sizeof(string), "%s voltou a jogar (/voltar)", PlayerName(playerid));
SendClientMessageToAll(COLOR_PASTEL, string);
}
else
{
SendClientMessage(playerid,COLOR_MARINHO,"Vocк Voltou Ao Jogo!");
return 1;
}
return 1;
}
}
public OnGameModeInit()
{
//AFK System
AfkText = TextDrawCreate(168.000000,319.000000,"Voce esta ~r~ausente");
TextDrawAlignment(AfkText,0);
TextDrawBackgroundColor(AfkText,0x000000ff);
TextDrawFont(AfkText,1);
TextDrawLetterSize(AfkText,1.000000,2.699999);
TextDrawColor(AfkText,0xffffffff);
TextDrawSetOutline(AfkText,1);
TextDrawSetProportional(AfkText,1);
TextDrawSetShadow(AfkText,1);
AfkBackText = TextDrawCreate(248.000000,351.000000,"Digite ~g~/voltar ~w~para sair!");
TextDrawAlignment(AfkBackText,0);
TextDrawBackgroundColor(AfkBackText,0x000000ff);
TextDrawFont(AfkBackText,1);
TextDrawLetterSize(AfkBackText,0.299999,1.100000);
TextDrawColor(AfkBackText,0xffffffff);
TextDrawSetOutline(AfkBackText,1);
TextDrawSetProportional(AfkBackText,1);
TextDrawSetShadow(AfkBackText,1);
return 1;
}