rcon cmds fackedup
#1

yaw ppl,

idk if this is samp bugg, but everytime i type something like "kick (playerid)" in the console, it completely closes the console... only at say it doesnt do that, but at every other one, how is this possible? and how to fix this?

greets niels
Reply
#2

what does the Server_log say ?
Reply
#3

Код:
Console input: say is rcon kick
Console input: say ok then
Console input: kick 1
[19:02:40] Jasmine_42711 <#1 - 24.3.71.114> has been kicked.
[19:02:40] Jasmine_42711(ID: 1) has left streetrodz racers   (Kicked/Banned)
[19:02:40] Jasmine_42711(ID: 1) has left streetrodz racers   (Leaving)

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3e-R2, ©2005-2012 SA-MP Team

[19:02:44] 
[19:02:44] Server Plugins
[19:02:44] --------------
[19:02:44]  Loading plugin: sscanf
[19:02:44]
thats a part of it, no errors as far as i see
Reply
#4

something OnPlayerDisconnect is making the server crash !
i cant think of anything else.
Reply
#5

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(IsPlayerNPC(playerid)) return 1;
    new str[128], pName[MAX_PLAYER_NAME], printstring[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    switch(reason)
    {
        case 0:
        {
            format(str, sizeof(str), "{00FF00}%s(ID: %d) {FFFFFF}has Left {00FF00}Street{FF0000}Rodz {0000FF}Racers {FFFFFF}(Timeout/Crash)", pName, playerid);
            format(printstring, sizeof(printstring), "%s(ID: %d) has left streetrodz racers   (Timeout/Crash)", pName, playerid);
        }
        case 1:
        {
            format(str, sizeof(str), "{00FF00}%s(ID: %d) {FFFFFF}has Left {00FF00}Street{FF0000}Rodz {0000FF}Racers {FFFFFF}(Leaving)", pName, playerid);
            format(printstring, sizeof(printstring), "%s(ID: %d) has left streetrodz racers   (Leaving)", pName, playerid);
        }
        case 2:
        {
            format(str, sizeof(str), "{00FF00}%s(ID: %d) {FFFFFF}has Left {00FF00}Street{FF0000}Rodz {0000FF}Racers {FFFFFF}(Kicked/Banned)", pName, playerid);
            format(printstring, sizeof(printstring), "%s(ID: %d) has left streetrodz racers   (Kicked/Banned)", pName, playerid);
        }
    }
    SendClientMessageToAll(COLOR_WHITE, str);
    TextDrawHideForPlayer(playerid, TeleportMessages);
    printf(printstring);
    new file[300];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"nAdmin/Users/%s.ini",name);
    PlayerInfo[playerid][score] = GetPlayerScore(playerid);
    PlayerInfo[playerid][cash] = GetPlayerMoney(playerid);
    if(logged[playerid] == 1)
    {
        dini_IntSet(file, "Score", PlayerInfo[playerid][score]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][cash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file, "VipLevel", PlayerInfo[playerid][VipLevel]);
        dini_IntSet(file, "Banned", PlayerInfo[playerid][Banned]);
        dini_IntSet(file, "Muted", PlayerInfo[playerid][Muted]);
    }
    logged[playerid] = 0;
    return 1;
}
seems nothing wrong to me...
Reply
#6

Maybe from another FS ?
Or you could start removing parts from the code e.g the saving status, then the prints.
Or debug it like so
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    if(IsPlayerNPC(playerid)) return 1;
    new str[128], pName[MAX_PLAYER_NAME], printstring[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    switch(reason)
    {
        case 0:
        {
            format(str, sizeof(str), "{00FF00}%s(ID: %d) {FFFFFF}has Left {00FF00}Street{FF0000}Rodz {0000FF}Racers {FFFFFF}(Timeout/Crash)", pName, playerid);
            format(printstring, sizeof(printstring), "%s(ID: %d) has left streetrodz racers   (Timeout/Crash)", pName, playerid);
            print("format 0");
        }
        case 1:
        {
            format(str, sizeof(str), "{00FF00}%s(ID: %d) {FFFFFF}has Left {00FF00}Street{FF0000}Rodz {0000FF}Racers {FFFFFF}(Leaving)", pName, playerid);
            format(printstring, sizeof(printstring), "%s(ID: %d) has left streetrodz racers   (Leaving)", pName, playerid);
            print("format 1");
        }
        case 2:
        {
            format(str, sizeof(str), "{00FF00}%s(ID: %d) {FFFFFF}has Left {00FF00}Street{FF0000}Rodz {0000FF}Racers {FFFFFF}(Kicked/Banned)", pName, playerid);
            format(printstring, sizeof(printstring), "%s(ID: %d) has left streetrodz racers   (Kicked/Banned)", pName, playerid);
            print("format 2");
        }
    }
    SendClientMessageToAll(COLOR_WHITE, str);
    print("MSG send");
    TextDrawHideForPlayer(playerid, TeleportMessages);
    print("txd hidden");
    printf(printstring);
    print("printf done");
    new file[300];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"nAdmin/Users/%s.ini",name);
    print("saving:0");
    PlayerInfo[playerid][score] = GetPlayerScore(playerid);
    PlayerInfo[playerid][cash] = GetPlayerMoney(playerid);
    if(logged[playerid] == 1)
    {
        print("saving started");
        dini_IntSet(file, "Score", PlayerInfo[playerid][score]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][cash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file, "VipLevel", PlayerInfo[playerid][VipLevel]);
        dini_IntSet(file, "Banned", PlayerInfo[playerid][Banned]);
        dini_IntSet(file, "Muted", PlayerInfo[playerid][Muted]);
        print"(saving end");
    }
    logged[playerid] = 0;
    print("logged out");
    return 1;
}
Run that and show what it says, so we can be a step closer to the problem.
Reply
#7

Код:
[19:03:47] --------------------------------------

[19:03:47]   Loading filterscript 'PPC_Housing.amx'...
[19:03:47] sscanf warning: String buffer overflow.
[19:03:47] ----------------------------------------
[19:03:47] PPC Housing filterscript initialized
[19:03:47] Houses loaded: 1385
[19:03:47] ----------------------------------------
[19:03:47]   Loading filterscript 'PPC_Business.amx'...
[19:03:47] -------------------------------------
[19:03:47] PPC Business filterscript initialized
[19:03:47] Businesses loaded: 192
[19:03:47] -------------------------------------
[19:03:47]   Loading filterscript 'InCar.amx'...
[19:03:47]  1st Person Vehicle Driving by Rati555
[19:03:47]   Loading filterscript 'grider.amx'...
[19:03:47] [FS]Ghostrider Loaded!
[19:03:47]   Loading filterscript 'CarWheelie.amx'...
[19:03:47] 
--------------------------------------
[19:03:47] Car Wheelie System by Niels44 Loaded!
[19:03:47] --------------------------------------

[19:03:47]   Loading filterscript 'GarPM.amx'...
[19:03:47] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[19:03:47] 	   GarPM v1.2 By [03]Garsino Successfully Loaded!	
[19:03:47] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[19:03:47]   Loading filterscript 'AFK.amx'...
[19:03:47] 
--------------------------------------
[19:03:47]  AFK/BRB System By [ADMIN]supers IS Loaded Successfully !
[19:03:47] --------------------------------------

[19:03:47]   Loaded 10 filterscripts.

[19:03:47] 
----------------------------------
[19:03:47] StreetRodzRacers script by Niels Loaded!
[19:03:47] ----------------------------------

[19:03:47] Number of vehicle models: 35
[19:03:47] Incoming connection: 127.0.0.1:63562
[19:03:47] Incoming connection: 127.0.0.1:63561
[19:03:47] Incoming connection: 127.0.0.1:63564
[19:03:47] Incoming connection: 127.0.0.1:63563
[19:03:47] [npc:join] Nicki_Minaj has joined the server (0:127.0.0.1)
[19:03:47] [npc:join] Katy_Perry has joined the server (1:127.0.0.1)
[19:03:47] [npc:join] Bruno_Mars has joined the server (2:127.0.0.1)
[19:03:47] [npc:join] Chuck_Norris has joined the server (3:127.0.0.1)
[19:04:16] Incoming connection: 192.168.2.3:50058
[19:04:16] [join] [HSD]Niels has joined the server (4:192.168.2.3)
[19:04:16] sscanf warning: String buffer overflow.
Console input: kick 4
[19:05:50] [HSD]Niels <#4 - 192.168.2.3> has been kicked.
[19:05:50] format 2
[19:05:50] MSG send
[19:05:50] txd hidden
[19:05:50] [HSD]Niels(ID: 4) has left streetrodz racers   (Kicked/Banned)
[19:05:50] printf done
[19:05:50] saving:0
[19:05:50] saving started
[19:05:50] saving end
[19:05:50] logged out
[19:05:50] [part] [HSD]Niels has left the server (4:2)
it seems to happen after all the prints, so im not sure if its cuz of the disconnect...

also wut about the sscanf warnings: string overflow, wut about that? i got it when joining and leaving, so i checked the strings, but theyre not overflowed, at connect i use 80 digits of the 100, so no overflow right?

greets niels
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)