Real time server restart command compiling problems, help pls
#1

Hello guys, please why I cant compile this? It is code for command, in which i set real time/seconds when server to restart. For example: I type /restart 5 it restarts in 5 seconds when i type /restart 15 00 It will restart in 15:00 real time, here is also saving before restart. But i do not know why I am getting these errors:

C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 3 : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 39) : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 40) : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 41) : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 42) : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 44) : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 4 : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 50) : error 017: undefined symbol "playerid"
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 67) : error 035: argument type mismatch (argument 1)
C:\Users\Jakub\Desktop\Server\gamemodes\LVRP.pwn(4 6 : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


10 Errors.

THE MISMATCH ERRORS LINES IN CODE/PLAYERIDS ARE ALL ERRORING (every error in the code)

pawn Код:
forward CasovyRestart();
public CasovyRestart()
{
    new  H, M;
    gettime (H, M);

    if (Hodina == H && Minuta == M)
    {
        SendClientMessageToAll (-1, "<Server> Za Minutu proběhne restart servru!");
        new INI:Subor = INI_Open (Umiestnenie (playerid)), Float:PoziciaX, Float:PoziciaY, Float:PoziciaZ, Float:Uhol;
        GetPlayerPos (playerid, PoziciaX, PoziciaY, PoziciaZ);
        GetPlayerFacingAngle (playerid, Uhol);
        INI_WriteInt (Subor, "AdminLevel", PouzivateloveInformacie [playerid] [pAdminLevel]);
        INI_WriteInt (Subor, "Peniaze", GetPlayerMoney (playerid));
        INI_SetTag (Subor, "Pozicia");
        INI_WriteInt (Subor, "Interier", GetPlayerInterior (playerid));
        INI_WriteFloat (Subor, "PoziciaX", PoziciaX);
        INI_WriteFloat (Subor, "PoziciaY", PoziciaY);
        INI_WriteFloat (Subor, "PoziciaZ", PoziciaZ);
        INI_WriteInt (Subor, "Skin", GetPlayerSkin (playerid));
        INI_WriteFloat (Subor, "Uhol", Uhol);
        INI_WriteInt (Subor, "VirtualnySvet", GetPlayerVirtualWorld (playerid));
        INI_Close (Subor);

        SetTimer ("RestartServeru", 1000*60, false);
    }
    SetTimer("CasovyRestart",1000*50,false);
    return 1;
}

YCMD:restart (playerid, params [], help)
{
        if (!IsPlayerAdmin (playerid)) return SendClientMessage (playerid, -1, "Tento prнkaћ mфћe pouћiť len administrбtor!");

        new  param1, param2;
        param1=strval(params);
        param2=chrfind(' ',params) + 1;
       
        //mismatch 1 error one line down
        if(strlen(param1)==0) return SendClientMessage (playerid, -1, "Zadej /restart [sekundy] nebo /restart [HH MM]");
        if(strlen(param2)==0)  //mismatch 2 error
        {
            GMX = 1;
            new str[100];
            format(str,100,"<Server> Prebehne reљtart serveru! za %d sekund",par1);
            SendClientMessageToAll (-1, "<Server> Prebehne reљtart serveru!");


            new INI:Subor = INI_Open (Umiestnenie (playerid)), Float:PoziciaX, Float:PoziciaY, Float:PoziciaZ, Float:Uhol;
            GetPlayerPos (playerid, PoziciaX, PoziciaY, PoziciaZ);
            GetPlayerFacingAngle (playerid, Uhol);
            INI_WriteInt (Subor, "AdminLevel", PouzivateloveInformacie [playerid] [pAdminLevel]);
            INI_WriteInt (Subor, "Peniaze", GetPlayerMoney (playerid));
            INI_SetTag (Subor, "Pozicia");
            INI_WriteInt (Subor, "Interier", GetPlayerInterior (playerid));
            INI_WriteFloat (Subor, "PoziciaX", PoziciaX);
            INI_WriteFloat (Subor, "PoziciaY", PoziciaY);
            INI_WriteFloat (Subor, "PoziciaZ", PoziciaZ);
            INI_WriteInt (Subor, "Skin", GetPlayerSkin (playerid));
            INI_WriteFloat (Subor, "Uhol", Uhol);
            INI_WriteInt (Subor, "VirtualnySvet", GetPlayerVirtualWorld (playerid));
            INI_Close (Subor);

            SetTimer ("RestartServeru", 1000*par1, false);
            }else{
            Hodina=par1;
            Minuta=par2;
            SetTimer("CasovyRestart",1000*50,false);
        }
        return true;
}
Thanks
Reply
#2

I dont understand this kind of language but i'll try my best
pawn Код:
forward CasovyRestart();
public CasovyRestart()
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++) {
        if(IsPlayerConnected(playerid) {
            new  H, M;
            gettime (H, M);

            if (Hodina == H && Minuta == M)
            {
                SendClientMessageToAll (-1, "<Server> Za Minutu probe(hne restart servru!");
                new INI:Subor = INI_Open (Umiestnenie (playerid)), Float:PoziciaX, Float:PoziciaY, Float:PoziciaZ, Float:Uhol;
                GetPlayerPos (playerid, PoziciaX, PoziciaY, PoziciaZ);
                GetPlayerFacingAngle (playerid, Uhol);
                INI_WriteInt (Subor, "AdminLevel", PouzivateloveInformacie [playerid] [pAdminLevel]);
                INI_WriteInt (Subor, "Peniaze", GetPlayerMoney (playerid));
                INI_SetTag (Subor, "Pozicia");
                INI_WriteInt (Subor, "Interier", GetPlayerInterior (playerid));
                INI_WriteFloat (Subor, "PoziciaX", PoziciaX);
                INI_WriteFloat (Subor, "PoziciaY", PoziciaY);
                INI_WriteFloat (Subor, "PoziciaZ", PoziciaZ);
                INI_WriteInt (Subor, "Skin", GetPlayerSkin (playerid));
                INI_WriteFloat (Subor, "Uhol", Uhol);
                INI_WriteInt (Subor, "VirtualnySvet", GetPlayerVirtualWorld (playerid));
                INI_Close (Subor);

                SetTimer ("RestartServeru", 1000*60, false);
            }
            SetTimer("CasovyRestart",1000*50,false);
        }
    }
    return 1;
}

YCMD:restart (playerid, params [], help)
{
        if (!IsPlayerAdmin (playerid)) return SendClientMessage (playerid, -1, "Tento prнkaћ mфћe pouћit( len administrбtor!");

        new part1;
        if(sscanf(params, "d",par1))
        {
            SendClientMessage (playerid, -1, "Zadej /restart [sekundy] nebo /restart [HH MM]");
            return 1;
        }
        GMX = 1;
        new str[100];
        format(str,100,"<Server> Prebehne reљtart serveru! za %d sekund",par1);
        SendClientMessageToAll (-1, str);


        new INI:Subor = INI_Open (Umiestnenie (playerid)), Float:PoziciaX, Float:PoziciaY, Float:PoziciaZ, Float:Uhol;
        GetPlayerPos (playerid, PoziciaX, PoziciaY, PoziciaZ);
        GetPlayerFacingAngle (playerid, Uhol);
        INI_WriteInt (Subor, "AdminLevel", PouzivateloveInformacie [playerid] [pAdminLevel]);
        INI_WriteInt (Subor, "Peniaze", GetPlayerMoney (playerid));
        INI_SetTag (Subor, "Pozicia");
        INI_WriteInt (Subor, "Interier", GetPlayerInterior (playerid));
        INI_WriteFloat (Subor, "PoziciaX", PoziciaX);
        INI_WriteFloat (Subor, "PoziciaY", PoziciaY);
        INI_WriteFloat (Subor, "PoziciaZ", PoziciaZ);
        INI_WriteInt (Subor, "Skin", GetPlayerSkin (playerid));
        INI_WriteFloat (Subor, "Uhol", Uhol);
        INI_WriteInt (Subor, "VirtualnySvet", GetPlayerVirtualWorld (playerid));
        INI_Close (Subor);

        SetTimer ("RestartServeru", 1000*par1, false);
        }else{
        Hodina=par1;
        Minuta=par2;
        SetTimer("CasovyRestart",1000*50,false);
        return true;
}
Reply
#3

Thanks, mate gonna to try it.. I forgot that I can use sscanf to this multiple params..
Reply
#4

Mate it dont work properly something is wrong with command writing. becouse when I use that command format tells me this: Server will be restarted at HOUR:MIN and it gives 0:0

I need to make this command work like this:

when i type one parameter it will restart in 5 sec for example. This works fine.
/restart 5

when i type with these two parameters it should set this time and when server real time reaches the 20:30 this should restart server.
/restart 20 30

But here is the problem this is not working, it not write these integers it is just saying so it is 0:0 So something with command is wrong.
Reply
#5

You know what you should do? You should make a command that saves all that shit like /saveserver then you should make a CMD that does this.

Код:
YCMD:restart(playerid, params[], help)
{
     new string[128]
     if(!IsPlayerAdmin (playerid)) return SendClientMessage (playerid, -1, "You, mista' %s, iz' no admin foo'!");
     SendClientMessageToAll(-1, "AdmCmd: Server Restart Initiated by %s. Do not leave the server!");
     SendRconCommand("gmx")
     return 1;
}
^^THIS is only a basic example of what you can do, but, I can assure that it works pretty well.
Sorry for the cringey ass gangsta lines, I added that for no apparant reason.
If you want that in ZCMD, here it is.

Код:
ZCMD:restart(playerid, params[])
{
     new string[128]
     if(!IsPlayerAdmin (playerid)) return SendClientMessage (playerid, -1, "You, mista' %s, iz' no admin foo'!");
     SendClientMessageToAll(-1, "AdmCmd: Server Restart Initiated by %s. Do not leave the server!");
     SendRconCommand("gmx")
     return 1;
}
If you want it in strcmp, well, firstly, your fucking old. Secondly, you've came to the wrong place babes <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)