Jump to content

pomoc [ Help ] Drag


Noob14_

Recommended Posts

Zdravím prosím moc jestli by mi to někdo neopravil díky moc mám tam mocc errorů prosím moc dík

 

 

#include <a_samp>
#include zcmd
#define p playerid
#define SCM SendClientMessage
#pragma tabsize 0
forward ControlDrag();
forward OnPlayerJoinInDrag(playerid);
forward OdpocitavaniDragu();
forward OnDragStart(zapisne);

forward DragWinned();
new RaceCPjoin[10];

new DragCPjoin;
new DragCPcil1;
new DragCPcil2;

new bool:DragCreated;
new bool:DragStarted;
new DragTimer;

new DragZapisne;
new DragVyhra;
new DragZavodnici;

new DragOdpocet;
public OnGameModeInit()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
DragOdpocet = 6;
DragCPjoin = SetPlayerRaceCheckPoint(i,2,-2675.0698,2175.9197,55.4297, 10, -1, -1, -1, 50.0);
RaceCPjoin[1] = SetPlayerRaceCheckPoint(i,2,42.5881,-1530.5800,4.9511, 25, -1, -1, -1, 100.0);
return 1;

    }
    
    
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    
        if(dialogid == 4522)
    {
     if(response == 1)
        {
            if(DragCreated == true)
            {
                //vytvořený..
                //new string[120];
                if(DragStarted != false) return SendClientMessage(playerid, 0xFF0000AA, "Drag je již odstartován, není možné se připojit.");
                OnPlayerJoinInDrag(playerid);
            }else{
                //nevytvořený..
                if(strval(inputtext) < 0) return SCM(playerid,-1,"Nemáš zapistne");
                new string[125];
                if(DragCreated != false) return SendClientMessage(playerid, 0xFF0000AA, "Drag je již vytvořen.");
                if(!inputtext[0]) return SendClientMessage(playerid, 0xFFFFFFFF, "Nezadal jsi žádnou částku");
                format(string, 125, "{9E69FF}[ {FFFFFF}Drag {9E69FF}] Byl vytvořen drag se zápisným {FFFFFF}%d$ {9E69FF}připojit se můžeš na /drag",strval(inputtext));
                SendClientMessageToAll(0xFFFFFFAA, string);
                MasPrachy(playerid, strval(inputtext));
                OnDragStart(strval(inputtext));
                OnPlayerJoinInDrag(playerid);
            }
        }
    }}}}
public OnPlayerEnterRaceCheckPoint(playerid, checkpointid)
{
    if(checkpointid == DragCPjoin)
    {
        if(info[playerid][nadragu] == 0)
        {
            if(DragCreated == true)
            {
                new string[120];
                format(string, 256, "{FFFFFF}Chceš se připojit do dragu se zápisným {FF00FF}%d${FFFFFF} ?",DragZapisne);
                ShowPlayerDialog(playerid,4522,DIALOG_STYLE_MSGBOX,"* Připojení do dragu *",string,"Připojit","Zavřít");
            }else{
                ShowPlayerDialog(playerid,4522,DIALOG_STYLE_INPUT,"* Vyvoření dragu *","{FFFFFF}Žádný drag není vytvořený. Můžeš ho vytvořit, napiš zápisné do dragu:","Vytvořit","Zavřít");
            }
        }else{
            SendClientMessage(playerid,-1,"Už jsi v dragu připojen!");
        }
    }
    if(checkpointid == DragCPcil1)
    {
        if(info[playerid][nadragu] == 1)
        {
            if(DragCreated == true)
            {
                if(DragStarted == true)
                {
                    new string[120];
                    format(string,sizeof(string),"~b~Drag s vyhrou ~y~%d$~b~ vyhral hrac ~p~%s",DragVyhra, Jmeno(playerid));
                    SendChatMessage(string);
                    GiveMoney(playerid,DragVyhra);
                    DestroyDynamicCP(DragCPcil1);
                    DestroyDynamicCP(DragCPcil2);
                    DragVyhra = 0;
                    DragCreated = false;
                    DragStarted = false;
                    DragZapisne = 0;
                    DragZavodnici = 0;
                    KillTimer(DragTimer);
                    for(new i= 0;i<=GetMaxPlayers();i++)
                    {
                        if(info[nadragu] != 0)
                        {
                            if(IsPlayerConnected(i)) info[nadragu] = 0;
                        }
                    }
                }
            }
        }
    }
    if(checkpointid == DragCPcil2)
    {
        if(info[playerid][nadragu] == 1)
        {
                if(DragStarted == true)
                {
                    new string[120];
                    format(string,sizeof(string),"~b~Drag s vyhrou ~y~%d$~b~ vyhral hrac ~p~%s",DragVyhra, Jmeno(playerid));
     SendClientMessageToAll(-1,string);
                    GiveMoney(playerid,DragVyhra);
                    DestroyDynamicCP(DragCPcil1);
                    DestroyDynamicCP(DragCPcil2);
                    DragVyhra = 0;
                    DragCreated = false;
                    DragStarted = false;
                    DragZapisne = 0;
                    DragZavodnici = 0;
                    KillTimer(DragTimer);
                    for(new i= 0;i<=GetMaxPlayers();i++)
                    {
                        if(info[nadragu] != 0)
                        {
                            if(IsPlayerConnected(i)) info[nadragu] = 0;
                        }
                    }
                }
        }
    }
    return 1;
}
public OnPlayerJoinInDrag(playerid)
{
    SendClientMessage(playerid, 0xFF0000AA, " ");
    SendClientMessage(playerid, 0xFF0000AA, "Připojil jsi se do dragu! Jeď k lajně u začátku mostu a počkej na start, ten bude do jedné minuty.");
    MasPrachy(playerid,DragZapisne);
    DragZavodnici ++;
    DragVyhra+=DragZapisne;
    GiveMoney(playerid,-DragZapisne);
    new string[120];
    format(string,sizeof(string),"~b~Hrac ~p~%s~b~ se pripojil do dragu vyhra je nyni ~y~%d$", Jmeno(playerid), DragVyhra);
    SendClientMessageToAll(-1,string);
    info[playerid][nadragu] = 1;
    return 1;
}
public OnDragStart(zapisne)
{
    DragCreated = true;
    DragZapisne = zapisne;
    SetTimer("ControlDrag", 60000, 0);
    return 1;
}
public ControlDrag()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
    DragCPcil1 = SetPlayerRaceCheckpoint(i,2,-2690.2146,1304.8533,55.4297, 15, -1, -1, -1, 200.0);
       DragCPcil2 =  SetPlayerRaceCheckpoint(i,2,-2672.5461,1304.8533,55.4297, 15, -1, -1, -1, 200.0);
       OdpocitavaniDragu();
       new string[120];
    format(string,sizeof(string),"~b~Drag byl odstartovan");
    SendChatMessage(string);
    DragTimer = SetTimer("DragWinned", 120000, 0);
    return 1;
}}
public OdpocitavaniDragu()
{
    new string[30];
    DragOdpocet --;
    format(string, sizeof(string), "%d",DragOdpocet);
    for(new i= 0;i<=GetMaxPlayers();i++)
    {
        if(info[nadragu] != 0)
        {
            if(IsPlayerConnected(i))
            {
                GameTextForPlayer(i,string,1000,6);
            }
        }
    }
    if(DragOdpocet != 0) return SetTimer("OdpocitavaniDragu", 1000,0);
    DragStarted = true;
    for(new i= 0;i<=GetMaxPlayers();i++)
    {
        if(info[nadragu] != 0)
        {
            if(IsPlayerConnected(i))
            {
                new Float:nic, Float:xcontrol;
                GetPlayerPos(i,nic,xcontrol,nic);
                if(xcontrol > 2144.3535)
                {
                    GameTextForPlayer(i,"~r~Start",1000,6);
                }else{
                    info[nadragu] = 0;
                    DragZavodnici --;
                //    InfoBox(i, "Byl jsi vyhzozen z dragu za to, ze nejsi na startu");
                }
                if(xcontrol > 2170.3535)
                {
                    info[nadragu] = 0;
                    DragZavodnici --;
                //    InfoBox(i, "Byl jsi vyhzozen z dragu za to, ze nejsi na startu");
                }else{
                    GameTextForPlayer(i,"~r~Start",1000,6);
                }
            }
        }
    }
    DragOdpocet = 6;
    return 1;
}
public DragWinned()
{
    DragVyhra = 0;
    DragCreated = false;
    DragStarted = false;
    DragZapisne = 0;
    DragZavodnici = 0;
    DragOdpocet = 6;
    DestroyDynamicCP(DragCPcil1);
    DestroyDynamicCP(DragCPcil2);
    for(new i= 0;i<=GetMaxPlayers();i++)
    {
        if(info[nadragu] != 0)
        {
            if(IsPlayerConnected(i)) info[nadragu] = 0;
        }
    }
    return 1;
}

 

 

Link to comment
Share on other sites

 

 

C:\Users\Pája\Desktop\text_test.pwn(32) : error 017: undefined symbol "SetPlayerRaceCheckPoint"
C:\Users\Pája\Desktop\text_test.pwn(33) : error 017: undefined symbol "SetPlayerRaceCheckPoint"
C:\Users\Pája\Desktop\text_test.pwn(39) : error 029: invalid expression, assumed zero
C:\Users\Pája\Desktop\text_test.pwn(39) : error 004: function "OnDialogResponse" is not implemented
C:\Users\Pája\Desktop\text_test.pwn(42) : error 017: undefined symbol "dialogid"
C:\Users\Pája\Desktop\text_test.pwn(44) : error 017: undefined symbol "response"
C:\Users\Pája\Desktop\text_test.pwn(50) : error 017: undefined symbol "playerid"
C:\Users\Pája\Desktop\text_test.pwn(51) : error 017: undefined symbol "playerid"
C:\Users\Pája\Desktop\text_test.pwn(54) : error 017: undefined symbol "inputtext"
C:\Users\Pája\Desktop\text_test.pwn(54) : error 017: undefined symbol "playerid"
C:\Users\Pája\Desktop\text_test.pwn(56) : error 017: undefined symbol "playerid"
C:\Users\Pája\Desktop\text_test.pwn(57) : error 017: undefined symbol "inputtext"
C:\Users\Pája\Desktop\text_test.pwn(57) : warning 215: expression has no effect
C:\Users\Pája\Desktop\text_test.pwn(57) : error 001: expected token: ";", but found "]"
C:\Users\Pája\Desktop\text_test.pwn(57) : error 029: invalid expression, assumed zero
C:\Users\Pája\Desktop\text_test.pwn(57) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright © 1997-2006, ITB CompuPhase


15 Errors.
 

 

 

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