SA-MP Forums Archive
Server:Unknown Commands - 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: Server:Unknown Commands (/showthread.php?tid=259622)



Server:Unknown Commands - ...:Lucian:... - 05.06.2011

i created this command and i go to server and said Unknown Commands he dont work
what i wrong

pawn Код:
dcmd_teamstats(playerid, cmdtext[])
{
        #pragma unused cmdtext
        new giveteamid, idx, tmp[256];
        tmp = strtok(cmdtext, idx);

        if (!strlen(tmp))
        {
            for (new i = 0; i < MAX_TURFS; i++) {
                 new msg[ 256 ];
                 format(msg, sizeof(msg), "~w~%s stats:~n~~g~Turfwars Won: %d~n~~r~Turfwars Lost: %d~n~~w~Rivals killed: %d~n~Homies lost: %d~n~~y~Turfs: %d~n~~w~Teamscore: %d",
                 TeamInfo[ gTeam[playerid] ][ TeamName ], TeamInfo[ gTeam[playerid] ][ TurfWarsWon ],
                 TeamInfo[ gTeam[playerid] ][ TurfWarsLost ], TeamInfo[ gTeam[playerid] ][ RivalsKilled ],
                 TeamInfo[ gTeam[playerid] ][ HomiesDied ], OwnedTurfs(), TeamInfo[ gTeam[playerid] ][ TeamScore ]);
                 new Text:txt = TextDrawCreate( 33.0, 261.0, msg);
                 TextDrawUseBox( txt, 1 );
                 TextDrawBoxColor( txt, 0x00000066 );
                 TextDrawTextSize( txt, 141.0, 0.0 );
                 TextDrawAlignment( txt, 0 );
                 TextDrawBackgroundColor( txt, 0x000000ff );
                 TextDrawFont( txt, 1 );
                 TextDrawLetterSize( txt, 0.29, 1.0 );
                 TextDrawColor( txt, 0xffffffff );
                 TextDrawSetOutline( txt, 1 );
                 TextDrawSetProportional( txt, 1 );
                 TextDrawSetShadow( txt, 1 );
                 TimeTextForPlayer( playerid, txt, 6000 );
                 return 1;
            }
        }
        giveteamid = strval(tmp);
        if ((giveteamid < 0 || giveteamid > 14)) {
            SendClientMessage(playerid, COLOR_RED, "No such teamid! Look at the teamid's.");
            SendClientMessage(playerid, COLOR_WHITE, "Grove: 1 l Ballas : 2 l Vagos: 3 l Aztegas: 4'");
            SendClientMessage(playerid, COLOR_WHITE, "Cop: 5 | Biker: 6 | Rapper: 7 ");
            return 1;
        }
        for (new i = 0; i < MAX_TURFS; i++) {
             new msg[ 256 ];
             format(msg, sizeof(msg), "~w~%s stats:~n~~g~Turfwars Won: %d~n~~r~Turfwars Lost: %d~n~~w~Rivals killed: %d~n~Homies lost: %d~n~~y~Turfs: %d~n~~w~Teamscore: %d",
             TeamInfo[ giveteamid ][ TeamName ], TeamInfo[ giveteamid ][ TurfWarsWon ],
             TeamInfo[ giveteamid ][ TurfWarsLost ], TeamInfo[ giveteamid ][ RivalsKilled ],
             TeamInfo[ giveteamid ][ HomiesDied ], OwnedTurfs2(giveteamid), TeamInfo[ giveteamid ][ TeamScore ]);
             new Text:txt = TextDrawCreate( 33.0, 261.0, msg);
             TextDrawUseBox( txt, 1 );
             TextDrawBoxColor( txt, 0x00000066 );
             TextDrawTextSize( txt, 141.0, 0.0 );
             TextDrawAlignment( txt, 0 );
             TextDrawBackgroundColor( txt, 0x000000ff );
             TextDrawFont( txt, 1 );
             TextDrawLetterSize( txt, 0.29, 1.0 );
             TextDrawColor( txt, 0xffffffff );
             TextDrawSetOutline( txt, 1 );
             TextDrawSetProportional( txt, 1 );
             TextDrawSetShadow( txt, 1 );
             TimeTextForPlayer( playerid, txt, 6000 );
             return 1;
        }
        return 1;
}



Re: Server:Unknown Commands - Stigg - 05.06.2011

At the end:
pawn Код:
return 0;
Might work.


Re: Server:Unknown Commands - ...:Lucian:... - 05.06.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
At the end:
pawn Код:
return 0;
Might work.
he not working
but th'x


AW: Server:Unknown Commands - Nero_3D - 05.06.2011

If I ignore the fact that the code is kind of meshed up (return in loops)
And the useage of some obsolete functions (like strtok)

I would say that you missed the dcmd part in OnPlayerCommandText


Re: AW: Server:Unknown Commands - ...:Lucian:... - 06.06.2011

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
If I ignore the fact that the code is kind of meshed up (return in loops)
And the useage of some obsolete functions (like strtok)

I would say that you missed the dcmd part in OnPlayerCommandText
nop this cmds is compilated

can help some one


AW: Server:Unknown Commands - Nero_3D - 06.06.2011

Quote:
Originally Posted by ...:Lucian:...
Посмотреть сообщение
nop this cmds is compilated

can help some one
Okey

And did you add

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
the dcmd part in OnPlayerCommandText
pawn Код:
dcmd(teamstats, 9, cmdtext);
?


Re: AW: Server:Unknown Commands - ...:Lucian:... - 06.06.2011

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Okey

And did you add



pawn Код:
dcmd(teamstats, 9, cmdtext);
?
he have

pawn Код:
dcmd(teamstats, 9, cmdtext);



AW: Server:Unknown Commands - Nero_3D - 06.06.2011

than did you try to put a print("Test") in each line to check where the code stops working ?

If it stops working it will return 0 => Unknown Command


Re: Server:Unknown Commands - necrobg3 - 06.06.2011

You're Wrong Whit This

new Text:txt = TextDrawCreate( 33.0, 261.0, msg);



Re: Server:Unknown Commands - ...:Lucian:... - 07.06.2011

Quote:
Originally Posted by necrobg3
Посмотреть сообщение
You're Wrong Whit This

new Text:txt = TextDrawCreate( 33.0, 261.0, msg);
is not this for why i dont have no error