Jump to content
  • 0

pomoc "relog"


DominusKristus

Dotaz

9 odpovědí na tuto otázku

Recommended Posts

  • 0

Kedysi to išlo, ale skúšal som to na 03x a myslím, že už to nefungovalo. 
Bola to taká chyba sampu, že keď hráča vyhodíš a má otvorené menu, tak ho to nevyhodí z hry, iba reconnectne či ako.

Link to comment
Share on other sites

  • 0

Zkus toto

new bool:reconnecting[MAX_PLAYERS];
new playersip[MAX_PLAYERS][16];

public OnPlayerConnect(playerid)
{
    reconnecting[playerid] = false;
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/relog", true) == 0)
    {
        if(reconnecting[playerid]) return SendClientMessage(playerid, 0xFF0000FF, "Už jsi byl relognut, čekej chvíli.");
        SendClientMessage(playerid, 0xFFFF00FF, "Nyní budeš relognut, čekej chvíli.");
        GetPlayerIp(playerid, playersip[playerid], 16);
        reconnecting[playerid] = true;
        new rconmsg[25];
        format(rconmsg, sizeof(rconmsg), "banip %s", playersip[playerid]);
        SendRconCommand(rconmsg);
        return 1;
    }
    return 0;
}

public OnPlayerDisconnect(playerid, reason)
{
    if(reconnecting[playerid])
    {
        new rconmsg[25];
        format(rconmsg, sizeof(rconmsg), "unbanip %s", playersip[playerid]);
        SendRconCommand(rconmsg);
        SendRconCommand("reloadbans");
    }
    return 1;
}

Našel jsem to tu - http://forum.sa-mp.com/showpost.php?p=2932823&postcount=4

Link to comment
Share on other sites

  • 0

if(reconnecting[playerid]) return SendClientMessage(playerid, 0xFF0000FF, "Už jsi byl relognut, čekej chvíli.");

 

Zmaž toto, aj tak keď sa reconnectne a medzitým sa pripojí hráč tak mu dá iné id a tá podmienka sa nemusí splniť.

Link to comment
Share on other sites

  • 0

A čo tak toto ??

#include <a_samp>
#define SRC SendRconCommand
#define SCM SendClientMessage
#define p playerid
#define m 0x33ccffaa

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/relog", cmdtext, true) == 0)
    {
         SRC("gmx"); //Ale to asi bude pre celý server.
         SCM(p,m,"Budeš relognutý");
         return 1;
    }
    return 0;
}
Link to comment
Share on other sites

  • 0

 

A čo tak toto ??

#include <a_samp>
#define SRC SendRconCommand
#define SCM SendClientMessage
#define p playerid
#define m 0x33ccffaa

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/relog", cmdtext, true) == 0)
    {
         SRC("gmx"); //Ale to asi bude pre celý server.
         SCM(p,m,"Budeš relognutý");
         return 1;
    }
    return 0;
}

To resetne celý server a zprávu budeš Relognutý by ti to stejně už neodeslalo

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...