Jump to content
  • 0

pomoc Pohyblivá brána - Error


Dexter1906

Dotaz

Dobrý deň, mám ďalší problém, spravil som si pohyblivú bránu, ale pri compilácii mi to vyhadzuje errory.

 

Errory:

error 021: symbol already defined: "CreateObject"
error 010: invalid function or declaration
error 021: symbol already defined: "OnPlayerCommandText"
error 030: compound statement not closed at the end of file (started at line 29119)

Kód:

//--------------------POHYBLIVÁ BRÁNA-------------------------

brana = CreateObject(980, 719.27142, -2733.54004, 4.57837,   0.00000, 0.00000, -89.87997);


    public OnPlayerCommandText(playerid, cmdtext[])
    {
        if(strcmp(cmdtext, "/otvorit", true) == 0) // Príkaz na otvorenie brány
    {        MoveObject(980, 719.27142, -2733.54004, 14.02122,   0.00000, 0.00000, -89.87997); // Cieľ presunutia brány
    SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku otvorená");        return 1;    }    if(strcmp(cmdtext, "/zatvorit", true) == 0)
{        MoveObject(980, 719.27142, -2733.54004, 4.57837,   0.00000, 0.00000, -89.87997); // Súradnice pôvodného miesta brány, 30.00 je rýchlosť zatvárania.
    SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku zatvorená");
        return 1;     }


//------------------------------------------------------------
Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0



brana = CreateObject(980, 719.27142, -2733.54004, 4.57837, 0.00000, 0.00000, -89.87997);


if(strcmp(cmdtext, "/otvorit", true) == 0) // Príkaz na otvorenie brány
{
MoveObject(brana, 719.27142, -2733.54004, 14.02122, 0.00000, 0.00000, -89.87997); // Cieľ presunutia brány
SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku otvorená");
return 1;
}
if(strcmp(cmdtext, "/zatvorit", true) == 0)
{
MoveObject(brana, 719.27142, -2733.54004, 4.57837, 0.00000, 0.00000, -89.87997); // Súradnice pôvodného miesta brány, 30.00 je rýchlosť zatvárania.
SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku zatvorená");
return 1;
}

 

Link to comment
Share on other sites

  • 0

C:\Users\Mayo\Desktop\pawno\CrazY.pwn(29102) : error 021: symbol already defined: "CreateObject"
C:\Users\Mayo\Desktop\pawno\CrazY.pwn(29115) : error 010: invalid function or declaration
C:\Users\Mayo\Desktop\pawno\CrazY.pwn(29118) : error 010: invalid function or declaration
C:\Users\Mayo\Desktop\pawno\CrazY.pwn(29122) : error 010: invalid function or declaration
C:\Users\Mayo\Desktop\pawno\CrazY.pwn(29124) : error 010: invalid function or declaration
C:\Users\Mayo\Desktop\pawno\CrazY.pwn(29128) : error 010: invalid function or declaration
C:\Users\Mayo\Desktop\pawno\CrazY.pwn(29132) : warning 203: symbol is never used: "brana"
Link to comment
Share on other sites

  • 0

To už mám.

Úplne celý kód brány je takto:

 

//--------------------POHYBLIVÁ BRÁNA-------------------------


new brana;


brana = CreateObject(980, 719.27142, -2733.54004, 4.57837,   0.00000, 0.00000, -89.87997);




if(strcmp(cmdtext, "/otvorit", true) == 0) // Príkaz na otvorenie brány
    {
MoveObject(brana, 719.27142, -2733.54004, 14.02122,   0.00000, 0.00000, -89.87997); // Cieľ presunutia brány
     SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku otvorená");
return 1;
}
if(strcmp(cmdtext, "/zatvorit", true) == 0)
{
MoveObject(brana, 719.27142, -2733.54004, 4.57837,   0.00000, 0.00000, -89.87997); // Súradnice pôvodného miesta brány, 30.00 je rýchlosť zatvárania.
     SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku zatvorená");
     return 1;
}


//------------------------------------------------------------
Link to comment
Share on other sites

  • 0

Kód vyzerá takto:

#include <a_samp>
#pragma tabsize 0
#define FILTERSCRIPT


new brana;


public OnFilterScriptInit()
{
    brana = CreateObject(980, 719.27142, -2733.54004, 4.57837,   0.00000, 0.00000, -89.87997);
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/otvorit", true) == 0) // Príkaz na otvorenie brány
{  MoveObject(brana, 719.27142, -2733.54004, 14.02122, 0.00000, 0.00000, -89.87997); // Cieľ presunutia brány
SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku otvorená");
return 1;
}
if(strcmp(cmdtext, "/zatvorit", true) == 0)
{  MoveObject(brana, 719.27142, -2733.54004, 4.57837, 0.00000, 0.00000, -89.87997); // Súradnice pôvodného miesta brány, 30.00 je rýchlosť zatvárania.
SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku zatvorená");
return 0;
}
return 1;
}

Toto je FilterScript, ale potom mi nefungujú žiadne príkazy na serveri, len chat neviem prečo.

Link to comment
Share on other sites

  • 0

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/otvorit", true) == 0) // Príkaz na otvorenie brány
{ MoveObject(brana, 719.27142, -2733.54004, 14.02122, 0.00000, 0.00000, -89.87997); // Cieľ presunutia brány
SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku otvorená");
return 1;
}
if(strcmp(cmdtext, "/zatvorit", true) == 0)
{ MoveObject(brana, 719.27142, -2733.54004, 4.57837, 0.00000, 0.00000, -89.87997); // Súradnice pôvodného miesta brány, 30.00 je rýchlosť zatvárania.
SendClientMessage(playerid, 0x008000AA, "Brána v Stunt Parku zatvorená");
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...