Jump to content
  • 0

pomoc Afk


Lerry

Dotaz

cs pokaždé když dám /afk tak mě to hodí že su afk a hned z5 že nejsu..

 

 

public OnPlayerCommandText(playerid, cmdtext[])

{

if(strcmp(cmdtext, "/afk", true) == 0)

{

new playername[24], str[256];

if(!AFK[playerid])

{

GetPlayerName(playerid, playername, 24);

format(str, 256, "%s (ID: %d) odesel na chvili od PC!", playername, playerid);

SendClientMessageToAll(COLOR_WHITE, str);

TogglePlayerControllable(playerid, false);

AFK[playerid] = true;

}

if(AFK[playerid])

{

GetPlayerName(playerid, playername, 24);

format(str, 256, "%s (ID: %d) se vratil k PC!", playername, playerid);

SendClientMessageToAll(COLOR_WHITE, str);

TogglePlayerControllable(playerid, true);

AFK[playerid] = false;

}

return true;

}

Link to comment
Share on other sites

2 odpovědí na tuto otázku

Recommended Posts

  • 0

Musíš jak zavíráš tu podmínku tam dat né "}" ale return 1; a "}"

Aby se tam příkaz zastavil, jinak ti to celé projede.

 

příklad:

 

if(!AFK[playerid])
{
GetPlayerName(playerid, playername, 24);
format(str, 256, "%s (ID: %d) odesel na chvili od PC!", playername, playerid);
SendClientMessageToAll(COLOR_WHITE, str);
TogglePlayerControllable(playerid, false);
AFK[playerid] = true;
return 1;
}

 

Takto si to doplň i u toho 2.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...