[Help]Server is shutting down
#1

When I run server and play little on them and when I enter a command /aon my server shut down.

Here is command /aon:

pawn Code:
CMD:aon(playerid,params[])
{
    new ime[MAX_PLAYER_NAME], ip[24];
    if(PI[playerid][Admin] >1 || IPA(playerid))
    {
        if(AdminDuznost[playerid] == 1) return SCM(playerid, BIJELA, ""COL_ZUTA"[INFO]"COL_BIJELA"Vec imate ukljucenu Admin duznost!");
        AdminDuznost[playerid] = 1;
        PostaviEnergiju(playerid, 5000);
        PostaviZastitu(playerid, 100);
        PostaviBoju(playerid, CRVENA);
        DajOruzje(playerid, 9, 20000);
        DajOruzje(playerid, 18, 20000);
        DajOruzje(playerid, 24, 20000);
        DajOruzje(playerid, 26, 20000);
        DajOruzje(playerid, 28, 20000);
        DajOruzje(playerid, 29, 20000);
        DajOruzje(playerid, 30, 20000);
        DajOruzje(playerid, 31, 20000);
        DajOruzje(playerid, 38, 20000);
        DajOruzje(playerid, 36, 20000);
        SCM(playerid, BIJELA, ""COL_ZUTA"[INFO]"COL_BIJELA"Ukljucio si se na Admin Duznost.");
        SCMA(BIJELA, ""COL_ZUTA"[INFO]"COL_CRVENA"Admin : "COL_BIJELA"%s "COL_CRVENA"| Duznost : "COL_BIJELA"Ukljucena");
        GetPlayerIp(playerid, ip, 24);
        format(CmdString, 80, "| Administrator | Igrac: %s | Duznost: Ukljucena | IP: %s", ime, ip);
        UpisiLog(FAJL_DUZNOSTLOG, CmdString);
    }
    else SCM(playerid, BIJELA, ""COL_ZUTA"[INFO]"COL_BIJELA"Zao nam je,nemate mogucnost da koristite ovu komandu!");
    return 1;
}
How ti fix that problem?
Reply
#2

pawn Code:
CMD :aon ( playerid , params [ ] )
{
    new ime [ MAX_PLAYER_NAME ] , ip [ 24 ] ;
    if(PI [ playerid ] [ Admin ] > 1 || IPA ( playerid ) )
    {
        if ( AdminDuznost [ playerid ] == 1 ) return SCM ( playerid , BIJELA , ""COL_ZUTA"[INFO]"COL_BIJELA"Vec imate ukljucenu Admin duznost!" ) ;
        AdminDuznost [ playerid ] = 1 ;
        PostaviEnergiju ( playerid , 5000 ) ;
        PostaviZastitu ( playerid , 100 ) ;
        PostaviBoju ( playerid , CRVENA ) ;
        DajOruzje ( playerid , 9 , 20000 ) ;
        DajOruzje ( playerid , 18 , 20000 ) ;
        DajOruzje ( playerid , 24 , 20000 ) ;
        DajOruzje ( playerid , 26 , 20000 ) ;
        DajOruzje ( playerid , 28 , 20000 ) ;
        DajOruzje ( playerid , 29 , 20000 ) ;
        DajOruzje ( playerid , 30 , 20000 ) ;
        DajOruzje ( playerid , 31 , 20000 ) ;
        DajOruzje ( playerid , 38 , 20000 ) ;
        DajOruzje ( playerid , 36 , 20000 ) ;
        SCM(playerid, BIJELA, ""COL_ZUTA"[INFO]"COL_BIJELA"Ukljucio si se na Admin Duznost." ) ;
        SCMA ( BIJELA , ""COL_ZUTA"[INFO]"COL_CRVENA"Admin : "COL_BIJELA"%s "COL_CRVENA"| Duznost : "COL_BIJELA"Ukljucena" ) ;
        GetPlayerIp(playerid, ip, 24);
        format ( CmdString , 80 , "| Administrator | Igrac: %s | Duznost: Ukljucena | IP: %s" , ime , ip ) ;
        UpisiLog ( FAJL_DUZNOSTLOG , CmdString ) ;
    }
    else {
        SCM ( playerid , BIJELA , ""COL_ZUTA"[INFO]"COL_BIJELA"Zao nam je,nemate mogucnost da koristite ovu komandu!" ) ;
    }
    return 1 ;
}
Reply
#3

No,it still don't working.
Reply
#4

Anybody?How to fix this problem?Is this because plugins,includes,or my server?
Reply
#5

Can't tell you how much I hate it when people write function names in their native language. Makes it all the harder for people from other countries to be able to help, or even understand your code in the first place. Keep function and variable names in understandable English.

I won't even bother translating it.
Reply
#6

Here we go.

pawn Code:
CMD:adminduty(playerid,params[])
{
    new name[MAX_PLAYER_NAME], ip[24];
    if(PlayerInfo[playerid][Admin] >1 || IsPlayerAdmin(playerid))
    {
        if(AdminDuty[playerid] == 1) return SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You already have Admin Duty on!");
        AdminDuty[playerid] = 1;
        SetPlayerHealth(playerid, 5000);
        SetPlayerArmour(playerid, 100);
        SetPlayerColor(playerid, CRVENA);
        GivePlayerWeapon(playerid, 9, 20000);
        GivePlayerWeapon(playerid, 18, 20000);
        GivePlayerWeapon(playerid, 24, 20000);
        GivePlayerWeapon(playerid, 26, 20000);
        GivePlayerWeapon(playerid, 28, 20000);
        GivePlayerWeapon(playerid, 29, 20000);
        GivePlayerWeapon(playerid, 30, 20000);
        GivePlayerWeapon(playerid, 31, 20000);
        GivePlayerWeapon(playerid, 38, 20000);
        GivePlayerWeapon(playerid, 36, 20000);
        SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You turn on Admin Duty.");
        SendClientMessageToAll(WHITE, ""COL_YELLOW"[INFO]"COL_RED"Admin : "COL_WHITE"%s "COL_RED"| Duty: "COL_WHITE"On");
        GetPlayerIp(playerid, ip, 24);
        format(CmdString, 80, "| Admin | Player: %s | Duty: On| IP: %s", ime, ip);
        WriteLog(FILE_DUTYLOG, CmdString);
    }
    else SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"Sorry,you don't have persmission to use this command!");
    return 1;
}
Reply
#7

Debugging can help you finding the cause of the problem.

pawn Code:
CMD:adminduty(playerid,params[])
{
    print("#1");
    new name[MAX_PLAYER_NAME], ip[24];
    if(PlayerInfo[playerid][Admin] >1 || IsPlayerAdmin(playerid))
    {
        print("#2");
        if(AdminDuty[playerid] == 1) return SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You already have Admin Duty on!");
        print("#3");
        AdminDuty[playerid] = 1;
        SetPlayerHealth(playerid, 5000);
        SetPlayerArmour(playerid, 100);
        SetPlayerColor(playerid, CRVENA);
        GivePlayerWeapon(playerid, 9, 20000);
        GivePlayerWeapon(playerid, 18, 20000);
        GivePlayerWeapon(playerid, 24, 20000);
        GivePlayerWeapon(playerid, 26, 20000);
        GivePlayerWeapon(playerid, 28, 20000);
        GivePlayerWeapon(playerid, 29, 20000);
        GivePlayerWeapon(playerid, 30, 20000);
        GivePlayerWeapon(playerid, 31, 20000);
        GivePlayerWeapon(playerid, 38, 20000);
        GivePlayerWeapon(playerid, 36, 20000);
        print("#4");
        SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You turn on Admin Duty.");
        SendClientMessageToAll(WHITE, ""COL_YELLOW"[INFO]"COL_RED"Admin : "COL_WHITE"%s "COL_RED"| Duty: "COL_WHITE"On");
        GetPlayerIp(playerid, ip, 24);
        print("#5");
        format(CmdString, 80, "| Admin | Player: %s | Duty: On| IP: %s", ime, ip);
        WriteLog(FILE_DUTYLOG, CmdString);
        print("#6");
    }
    else {
        print("#7: server is returning false(value: 0) for: AdminDuty[playerid] == 1");
        SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"Sorry,you don't have persmission to use this command!");
    }
    return 1;
}
Note: if it doesn't print #2 but it does print #7, it means that the player is not on admin duty.
Please post where it ends
Reply
#8

The command don't work server again shutting down here is crash.txt :
Quote:

--------------------------

SA-MP Server: 0.3d-R2



Exception At Address: 0x00492AAC



Registers:

EAX: 0x4646467B EBX: 0x0161CF73 ECX: 0x7FFFFFFE EDX: 0x0012ECF5

ESI: 0x0012E938 EDI: 0x0012F11C EBP: 0x0012E984 ESP: 0x0012E8F8

EFLAGS: 0x00010202



Stack:

+0000: 0x0012F0D0 0x0012ECD0 0x0161CF88 0xABBDCC05

+0010: 0x00490D6C 0x00000000 0x00000000 0x00000007

+0020: 0x00000000 0xABBDCC05 0x00000000 0x00000000

+0030: 0x00000000 0x00000000 0x00000000 0xABBDCC05

+0040: 0x00000026 0x00000000 0x4646467B 0xFFFFFFFF

+0050: 0x00000000 0x00000002 0x00000003 0xABBDCC05

+0060: 0x00000D6C 0x00456193 0x00000000 0x00000001

+0070: 0x004A7E50 0xABBD0D6C 0x000001CB 0x00000800

+0080: 0x00000000 0x0012E981 0xAA751401 0xFFFF5F00

+0090: 0x00A0E5FF 0xC8680F00 0x0606C6C8 0x2969AB0F

+00A0: 0xAFEBC9C8 0xC8C8C868 0xABCFC8C8 0x0EA4EE2D

+00B0: 0xC44DAE8E 0x08C4ED0D 0x2DAD8D2C 0xAE8E08C4

+00C0: 0xADC0258F 0x84CC2DAC 0x7C910020 0x00B75380

+00D0: 0x00CB0000 0x00D43D01 0x00B75380 0x7C910222

+00E0: 0x0000001B 0x00000028 0x00000000 0x00A50178

+00F0: 0x0012E7E0 0x00495576 0x0012EA88 0x00000001

+0100: 0x7C9101E0 0xFFFFFFFF 0x7C9101DB 0x00000000

+0110: 0x00B70000 0x00D63CD8 0x00CB0000 0x0012EB04

+0120: 0x4E4F4352 0x6E492820 0x6D61472D 0x203A2965

+0130: 0x79616C50 0x23207265 0x44282030 0x796E6E61
And server_log.txt :

Quote:

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

SA-MP Dedicated Server
----------------------
v0.3d-R2, ©2005-2011 SA-MP Team

[17:32:56]
[17:32:56] Server Plugins
[17:32:56] --------------
[17:32:56] Loading plugin: streamer
[17:32:56]

*** Streamer Plugin v2.6 by Incognito loaded ***

[17:32:56] Loaded.
[17:32:56] Loading plugin: sscanf
[17:32:56]

[17:32:56] ===============================

[17:32:56] sscanf plugin loaded.

[17:32:56] © 2009 Alex "Y_Less" Cole

[17:32:56] 0.3d-R2 500 Players "dnee"

[17:32:56] ===============================

[17:32:56] Loaded.
[17:32:56] Loaded 2 plugins.

[17:32:56]
[17:32:56] Filterscripts
[17:32:56] ---------------
[17:32:56] Loading filterscript 'ExecFunctions.amx'...
[17:32:56] Loaded 1 filterscripts.

[17:32:56]
[17:32:56] =======================================
[17:32:56] | |
[17:32:56] | YSI version 1.04.0000 |
[17:32:56] | By Alex "Y_Less" Cole |
[17:32:56] | |
[17:32:56] =======================================
[17:32:56]
[17:32:56] OnGameo
[17:32:56]
----------------------------------
[17:32:56] Satellite DM v1.0
[17:32:56] ----------------------------------

[17:32:56] Number of vehicle models: 0
[17:33:24] Incoming connection: 5.204.189.171:3436
[17:33:24] [join] Danny has joined the server (0:5.204.189.171)
[17:33:42] #1
[17:33:42] #7: server is returning false(value: 0) for: AdminDuznost[playerid] == 1
[17:33:58] RCON (In-Game): Player #0 (Danny) has logged in.
[17:33:59] #1
[17:33:59] #2
[17:33:59] #3
[17:33:59] #4

Reply
#9

Okay, so it stops at #4. Try if it still crashes with this code.

pawn Code:
CMD:adminduty(playerid,params[])
{
    print("#1");
    new name[MAX_PLAYER_NAME], ip[24];
    if(PlayerInfo[playerid][Admin] >1 || IsPlayerAdmin(playerid))
    {
        print("#2");
        if(AdminDuty[playerid] == 1) return SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You already have Admin Duty on!");
        print("#3");
        AdminDuty[playerid] = 1;
        SetPlayerHealth(playerid, 5000);
        SetPlayerArmour(playerid, 100);
        SetPlayerColor(playerid, CRVENA);
        GivePlayerWeapon(playerid, 9, 20000);
        GivePlayerWeapon(playerid, 18, 20000);
        GivePlayerWeapon(playerid, 24, 20000);
        GivePlayerWeapon(playerid, 26, 20000);
        GivePlayerWeapon(playerid, 28, 20000);
        GivePlayerWeapon(playerid, 29, 20000);
        GivePlayerWeapon(playerid, 30, 20000);
        GivePlayerWeapon(playerid, 31, 20000);
        GivePlayerWeapon(playerid, 38, 20000);
        GivePlayerWeapon(playerid, 36, 20000);
        print("#4");
    }
    else {
        print("#7: server is returning false(value: 0) for: AdminDuty[playerid] > 1, IsPlayerAdmin(playerid)");
        SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"Sorry,you don't have persmission to use this command!");
    }
    print("#8");
    return 1;
}
Reply
#10

Working now but what about this :

pawn Code:
SendClientMessage(playerid, WHITE, ""COL_YELLOW"[INFO]"COL_WHITE"You turn on Admin Duty.");
        SendClientMessageToAll(WHITE, ""COL_YELLOW"[INFO]"COL_RED"Admin : "COL_WHITE"%s "COL_RED"| Duty: "COL_WHITE"On");
        GetPlayerIp(playerid, ip, 24);
        format(CmdString, 80, "| Admin | Player: %s | Duty: On| IP: %s", ime, ip);
        WriteLog(FILE_DUTYLOG, CmdString);
    }
I need this and command /aoff:

pawn Code:
CMD:aoff(playerid,params[])
{
    print("#1");
    new ime[MAX_PLAYER_NAME], ip[24];
    if(PI[playerid][Admin] >1 || IPA(playerid))
    {
    print("#2");
PostaviEnergiju(playerid, 100);
PostaviZastitu(playerid, 0);
ResetirajOruzje(playerid);
PostaviBoju(playerid, BIJELA);
SCM(playerid, BIJELA, ""COL_ZUTA"| DannyAS | "COL_BIJELA"Iskljucio si se sa Admin Duznosti.");
SCMA(BIJELA, ""COL_ZUTA"| DannyAS | "COL_CRVENA"Admin : "COL_BIJELA"%s "COL_CRVENA"| Duznost : "COL_BIJELA"Iskljucena");
GetPlayerIp(playerid, ip, 24);
format(CmdString, 80, "| Administrator | Igrac : %s | Duznost : Iskljucena | IP : %s", ime, ip);
UpisiLog(FAJL_DUZNOSTLOG, CmdString);
print("#3");
}
    else SCM(playerid, BIJELA, ""COL_ZUTA"| DannyAS | "COL_BIJELA"Zao nam je,nemate mogucnost da koristite ovu komandu!");
    print("#4");
    return 1;
}
Is there ok?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)