Jump to content
  • 0

pomoc Port


Stellet

Dotaz

Ahoj chtěl bych udělat že příkazem se uloží port a pak se na něj lidi mohou portovat:

 

 

static Float:pP[3];
static bool:PortState;

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/ulozport", cmdtext, true, 10) == 0)
    {
        GetPlayerPos(playerid, pP[0], pP[1], pP[2]);
        return 1;
    }
    if (strcmp("/aport", cmdtext, true, 10) == 0)
    {
        if(PortState == true) SetPlayerPos(playerid, pP[0], pP[1], pP[2]);
        else SendClientMessage(playerid, -1, "Admin Port je vypnut");
    }
    if (strcmp("/aporton", cmdtext, true, 10) == 0)
    {
        if(PortState == true) PortState = false;
        return 1;
    }
    if (strcmp("/aportoff", cmdtext, true, 10) == 0)
    {
        if(PortState == false) PortState = true;
        return 1;
    }
    return 0;
}

 

žádný error ale ve hře to furt píše Port je vypnutý..

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0

Dúfam že funguje :)

 

 

 

static Float:pP[3];
static PortState[MAX_PLAYERS];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/ulozport", cmdtext, true, 10) == 0)
    {
        GetPlayerPos(playerid, pP[0], pP[1], pP[2]);
        return 1;
    }
    if (strcmp("/aport", cmdtext, true, 10) == 0)
    {
        if(PortState == 0) retunr SendClientMessage(playerid, -1, "Admin Port je vypnut");
    SetPlayerPos(playerid,pP[0],pP[1],pP[2]);
    return 1;
    }
    if (strcmp("/aporton", cmdtext, true, 10) == 0)
    {
        PortState[playerid] = 1;
    GetPlayerPos(playerid, pP[0], pP[1], pP[2]);
        return 1;
    }
    if (strcmp("/aportoff", cmdtext, true, 10) == 0)
    {
        PortState[playerid] = 0;
        return 1;
    }
    return 0;
}

 

 

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