SA-MP Forums Archive
PROBLEM! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PROBLEM! (/showthread.php?tid=263604)



PROBLEM! - SILENT! - 22.06.2011

pawn Код:
CMD:gate(playerid,params[]) {
    new
        gate,
        string[256],
        Float:Positions[2][3];
    if(sscanf(params, "s[64]", gate))   {
        return SendClientMessage(playerid,COLOR_WHITE,SYNTAX_MESSAGE"/gate [gate]");
    }
    if(!strcmp(params, "office1",true)) {
        GetPlayerPos( playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
        GetObjectPos(office1, Positions[1][0], Positions[1][1], Positions[1][2]);
        GetObjectPos(office2, Positions[1][0], Positions[1][1], Positions[1][2]);
        if(GetDistance( Positions[0][0], Positions[0][1], Positions[0][2], Positions[1][0], Positions[1][1], Positions[1][2]) < 15.0 )
        {
            MoveObject(office1, 239.64657593,115.25,1002.21875000, 1); //LSPD 1
            MoveObject(office2, 239.57249451,119.89,1002.21502686, 1); //LSPD 2
        }

    }
    return 1;
}
Where is the problem?

My server crash here: if(!strcmp(params, "office1",true)) {


Re: PROBLEM! - 0_o - 22.06.2011

pawn Код:
CMD:gate(playerid,params[]) {
    new
        gate,
        string[256],
        Float:Positions[2][3];
    if(sscanf(params, "s[64]", gate))   {
        return SendClientMessage(playerid,COLOR_WHITE,SYNTAX_MESSAGE"/gate [gate]");
    }
    if(!strcmp(params, "office1",true)) {
        GetPlayerPos( playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
        GetObjectPos(office1, Positions[1][0], Positions[1][1], Positions[1][2]);
        GetObjectPos(office2, Positions[1][0], Positions[1][1], Positions[1][2]);
        if(GetDistance( Positions[0][0], Positions[0][1], Positions[0][2], Positions[1][0], Positions[1][1], Positions[1][2]) < 15.0 )
        {
            MoveObject(office1, 239.64657593,115.25,1002.21875000, 1); //LSPD 1
            MoveObject(office2, 239.57249451,119.89,1002.21502686, 1); //LSPD 2
        }

    }
}
    return 1;
}
Try This.


Re: PROBLEM! - SILENT! - 22.06.2011

Too much } lol.


Re: PROBLEM! - SILENT! - 22.06.2011

So...?


Re: PROBLEM! - SILENT! - 23.06.2011

pawn Код:
CMD:gate(playerid,params[]) {
    new
        gate,
        string[256],
        Float:Positions[2][3];
    if(sscanf(params, "s[64]", gate))   {
        return SendClientMessage(playerid,COLOR_WHITE,SYNTAX_MESSAGE"/gate [gate]");
    }
    if(!strcmp(params, "office1",true)) {
        GetPlayerPos( playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
        GetObjectPos(office1, Positions[1][0], Positions[1][1], Positions[1][2]);
        GetObjectPos(office2, Positions[1][0], Positions[1][1], Positions[1][2]);
        if(GetDistance( Positions[0][0], Positions[0][1], Positions[0][2], Positions[1][0], Positions[1][1], Positions[1][2]) < 15.0 )
        {
            MoveObject(office1, 239.64657593,115.25,1002.21875000, 1); //LSPD 1
            MoveObject(office2, 239.57249451,119.89,1002.21502686, 1); //LSPD 2
        }

    }
    return 1;
}
Where is the problem?

My server crash here: if(!strcmp(params, "office1",true)) {


Re: PROBLEM! - Sasino97 - 23.06.2011

Quote:
Originally Posted by SILENT!
Посмотреть сообщение
pawn Код:
CMD:gate(playerid,params[]) {
    new
        gate,
        string[256],
        Float:Positions[2][3];
    if(sscanf(params, "s[64]", gate))   {
        return SendClientMessage(playerid,COLOR_WHITE,SYNTAX_MESSAGE"/gate [gate]");
    }
    if(!strcmp(params, "office1",true)) {
        GetPlayerPos( playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
        GetObjectPos(office1, Positions[1][0], Positions[1][1], Positions[1][2]);
        GetObjectPos(office2, Positions[1][0], Positions[1][1], Positions[1][2]);
        if(GetDistance( Positions[0][0], Positions[0][1], Positions[0][2], Positions[1][0], Positions[1][1], Positions[1][2]) < 15.0 )
        {
            MoveObject(office1, 239.64657593,115.25,1002.21875000, 1); //LSPD 1
            MoveObject(office2, 239.57249451,119.89,1002.21502686, 1); //LSPD 2
        }

    }
    return 1;
}
Where is the problem?

My server crash here: if(!strcmp(params, "office1",true)) {
pawn Код:
CMD:gate(playerid,params[]) {
    new
        gate,
        string[256],
        Float:Positions[2][3];
    if(sscanf(params, "s[64]", gate))   {
        return SendClientMessage(playerid,COLOR_WHITE, SYNTAX_MESSAGE"/gate [gate]"); //OMG What's this? SYNTAX_MESSAGE, is it a colour??
    }
    if(!strcmp(params, "office1",true)) {
        GetPlayerPos( playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
        GetObjectPos(office1, Positions[1][0], Positions[1][1], Positions[1][2]);
        GetObjectPos(office2, Positions[1][0], Positions[1][1], Positions[1][2]);
        if(GetDistance( Positions[0][0], Positions[0][1], Positions[0][2], Positions[1][0], Positions[1][1], Positions[1][2]) < 15.0 )
        {
            MoveObject(office1, 239.64657593,115.25,1002.21875000, 1); //LSPD 1
            MoveObject(office2, 239.57249451,119.89,1002.21502686, 1); //LSPD 2
        }

    }
    return 1;
}
I think the error is in the SendClientMessage, I've never seen a "_DEFINED_VALUE"string"_", to put colours in text, use {RRGGBB} in the string

can you show the define of SYNTAX_MESSAGE?


Re: PROBLEM! - SILENT! - 23.06.2011

LOL! SYNTAX_MESSAGE is a text something like "SYNTAX:" .

Wasn't from there, was from strcmp.

Resolved.