Help Me Please
#1

I didn't runcomplie

C:\Documents and Settings\NEW\My Documents\дїЕм·ХидґйГСєўН§©С№\MrIllusion\MrIllusio n\gamemodes\eRP.pwn(36182) : warning 201: redefinition of constant/macro (symbol "COLOR_AFK")
C:\Documents and Settings\NEW\My Documents\дїЕм·ХидґйГСєўН§©С№\MrIllusion\MrIllusio n\gamemodes\eRP.pwn(36202) : error 021: symbol already defined: "OnFilterScriptExit"
C:\Documents and Settings\NEW\My Documents\дїЕм·ХидґйГСєўН§©С№\MrIllusion\MrIllusio n\gamemodes\eRP.pwn(36210) : error 021: symbol already defined: "JB_OnPlayerConnect"
C:\Documents and Settings\NEW\My Documents\дїЕм·ХидґйГСєўН§©С№\MrIllusion\MrIllusio n\gamemodes\eRP.pwn(36219) : error 021: symbol already defined: "JB_OnPlayerCommandText"
C:\Documents and Settings\NEW\My Documents\дїЕм·ХидґйГСєўН§©С№\MrIllusion\MrIllusio n\gamemodes\eRP.pwn(36311) : error 021: symbol already defined: "OnRconCommand"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

-------------------------------------------------------------------------------------------------------------------
------------------------------------------------SCript AFK---------------------------------------------------------

#include <a_samp>

#define FILTERSCRIPT
#define COLOR_AFK 0x5A5454FF
new afk[MAX_PLAYERS];
new afktime = 600000;//10 mins
new afktimer;
new Float:AFKPos[MAX_PLAYERS][6];
new invafk[MAX_PLAYERS];

forward AutoAFK();


public OnFilterScriptInit()
{
printf("\n--------------------------------------");
printf("-------- AFK sistem by Hunter --------");
printf("--------------------------------------\n");
afktimer = SetTimer("AutoAFK", afktime, 1);
return 1;
}

public OnFilterScriptExit()
{
KillTimer(afktimer);
return 1;
}



public OnPlayerConnect(playerid)
{
afk[playerid] = 0;
invafk[playerid] = 0;
return 1;
}



public OnPlayerCommandText(playerid, cmdtext[])
{
#pragma tabsize 0
new string[256];
if (strcmp("/afk", cmdtext, true) == 0)
{
if(afk[playerid] == 0)
{
afk[playerid] = 1;
TogglePlayerControllable(playerid,false);
SetCameraBehindPlayer(playerid);
SetPlayerColor(playerid,COLOR_AFK);
SendClientMessage(playerid,0x0009FFFF,"Acum esti AFK,ca sa revii din AFK scrie /back");
}
else
{
SendClientMessage(playerid,0x0009FFFF,"Esti deja AFK");
}
return 1;
}
if (strcmp("/back", cmdtext, true) == 0)
{
if(afk[playerid] == 1)
{
afk[playerid] = 0;
TogglePlayerControllable(playerid,true);
SetCameraBehindPlayer(playerid);
while (afk[playerid] == 0)
{
new color = GetPlayerColor(playerid);
SetPlayerColor(playerid,color);
}
SendClientMessage(playerid,0x009FFFF,"Acum te-ai intors,ca sa fi din nou AFK scrie /afk");
}
else
{
SendClientMessage(playerid,0x0009FFFF,"Nu esti AFK");
}
return 1;
}
if (strcmp("/afklist", cmdtext, true) == 0)
{
SendClientMessage(playerid, 0x0009FFFF, "|__AFK_LIST__|");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(afk[i] == 1)
{
new name[128];
GetPlayerName(i,name,12;
format(string, 256, "%s", name);
SendClientMessage(playerid, 0xFFFFFFAA, string);
}
}
}
return 1;
}
if (strcmp("/invafk", cmdtext, true) == 0)
{
if(invafk[playerid] == 0)
{
invafk[playerid] = 1;
TogglePlayerControllable(playerid,false);
SetCameraBehindPlayer(playerid);
ShowNameTags(false);
SendClientMessage(playerid,0x0009FFFF,"Acum esti AFK invizibil,ca sa revii din AFK scrie /invback");
}
else
{
SendClientMessage(playerid,0x0009FFFF,"Esti deja AFK");
}
return 1;
}
if (strcmp("/invback", cmdtext, true) == 0)
{
if(invafk[playerid] == 1)
{
invafk[playerid] = 0;
TogglePlayerControllable(playerid,true);
SetCameraBehindPlayer(playerid);
ShowNameTags(true);
SendClientMessage(playerid,0x009FFFF,"Acum te-ai intors,ca sa fi din nou AFK invizibil scrie /invafk");
}
else
{
SendClientMessage(playerid,0x0009FFFF,"Nu esti AFK");
}
return 1;
}
return 0;
}
public OnRconCommand(cmd[])
{
new string[256];
if (strcmp("/kickallafk", cmd, true) == 0)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(afk[i] == 1 || invafk[i] == 1)
{
new name[128];
GetPlayerName(i,name,12;
format(string,256, "%s has kicked all AFK players.",name);
SendClientMessage(i,0xFF6347AA,string);
printf(string);
Kick(i);
}
}


return 1;
}
return 0;
}

public AutoAFK()
{

for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, AFKPos[i][0], AFKPos[i][1], AFKPos[i][2]);
AFKPos[i][3] = AFKPos[i][0];
AFKPos[i][4] = AFKPos[i][1];
AFKPos[i][5] = AFKPos[i][2];
if(AFKPos[i][0] == AFKPos[i][3] && AFKPos[i][1] == AFKPos[i][4] && AFKPos[i][2] == AFKPos[i][5] && afk[i] == 0)
{
SetPlayerColor(i,COLOR_AFK);
afk[i] = 1;
}
else if(AFKPos[i][0] != AFKPos[i][3] && AFKPos[i][1] != AFKPos[i][4] && AFKPos[i][2] != AFKPos[i][5] && afk[i] == 1)
{
while (afk[i] == 0)
{
new color = GetPlayerColor(i);
SetPlayerColor(i,color);
}
afk[i] = 0;
}
}
}
-------------------------------------------------------------------------------------------------------------------------------------------

please help me



Reply
#2

use
Код:
you code
next time

And about the errors... I get different errors with this same piece of code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)