Jump to content
  • 0

VA ROG AJUTATI MA CU AFKKcker


susu

Question

#define AFKTime 1

#define COLOR_AFK 0x524F50AA

new AFKMins[MAX_PLAYERS];

punlic OnplayerConnect(payerid)

  PPos[playerid][0] = 0;

  PPos[playerid][1] = 0;

  Pos[playerid][2] = 0;

  AFKMins[playerid] = 0;

public OngameModeInit

SetTimer("AFKKicker", 60000, true);

public OnPlayerCommandText(playerid, cmdtext[])

//----------------------------------[/cuw]------------------------------------------------

    if(strcmp(cmd, "/cuw", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "Folosite: /cuw [playerid/PartOfName]");

return 1;

}

giveplayerid = ReturnUser(tmp);

if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pHelper] >= 2)

{

if(IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[64];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "Folosire: /cuw [playerid/PartOfName]");

return 1;

}

new year, month,day;

getdate(year, month, day);

format(string, sizeof(string), "[bot]: {FFFF00} %s a primit kick pentru ca a lasat AFK cu wanted!", giveplayer, sendername, (result),month,day,year);

format(string, sizeof(string), "[bot]: {FFFF00} %s a primit kick pentru ca a lasat AFK cu wanted!", giveplayer, sendername, (result));

SendClientMessageToAll(COLOR_RED, string);

KickLog(string);

Kick(giveplayerid);

return 1;

}

}

}

else

{

format(string, sizeof(string), "  %d nu este pe server.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}

//----------------------------------[drum]------------------------------------------------

    if(strcmp(cmd, "/ind", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ind [playerid/PartOfName]");

return 1;

}

giveplayerid = ReturnUser(tmp);

if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pHelper] >= 2)

{

if(IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[64];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "Folosire: /ind [playerid/PartOfName]");

return 1;

}

new year, month,day;

getdate(year, month, day);

format(string, sizeof(string), "[bot]: {FFFF00} %s a primit kick pentru ca a lasat AFK in drum!", giveplayer, sendername, (result),month,day,year);

format(string, sizeof(string), "[bot]: {FFFF00} %s a primit kick pentru ca a lasat AFK in drum!", giveplayer, sendername, (result));

SendClientMessageToAll(COLOR_LIGHTRED, string);

KickLog(string);

Kick(giveplayerid);

return 1;

}

}

}

else

{

format(string, sizeof(string), "  %d nu este pe server.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}

la sfarsitul gamemodului am asta

////////////afk///

forward AFKKicker();

public AFKKicker()

{

for(new i = 0; i <= MAX_PLAYERS; i++)

{

    if(PPos[1] == 0)

    {

        GetPlayerPos(i,PPos[0],PPos[1],PPos[2]);

        return 1;

}

new Float:x,Float:y,Float:z;

GetPlayerPos(i,x,y,z);

if(x == PPos[0] && y == PPos[1] && z == PPos[2])

{

    AFKMins++;

    if(AFKMins >= AFKTime)

    {

            SetPlayerColor(i,0x524F50AA);

}

}

else

{

                            }

}

return 1;

}

Cum fac ca cand lasa afk dupa un minut  sa apara culoare care e pusa si cand nu mai este afk sai apara culoare pe care o avea , aia de la civil sau de la factiuni , Va rog frumos sa  ma ajutati daca stiti!

cand lasf afk apare culoare aia de afk la player dar nu mere uneori apara alteori nu apare

si daca stii daca lasa cu wanted sau in drum sai dea kick automat

va rog frumos sa ma ajutati daca stiti

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.