zcmd problem?
#1

pawn Код:
CMD:stats(playerid, params[])
{
    new id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1,"{ff0000}Error: {ffffff}Correct usage: /stats (playerid)");
    if(!IsPlayerConnected(playerid)) return SCM(playerid, -1, "{ff0000}Error: {ffffff}That Player Is Not Connected");
    new string[128];
    format(string, sizeof(string), "{f7ea00}~~~~~~~~%s(%d)~~~~~~~ \n {ff0000}Kills: {00ff19}%d \n {ff0000}Deaths: {00ff19}%d \n {ff0000}Death Racing Won: {00ff19}%d \n {ff0000}Duels Won: {00ff19}%d \n {ff0000}Kill/Death Ratio: {00ff19}%d", GetName(id), id, Kills[id], Deaths[id], DerbyWon[id], DuelWon[id], Kills[id]/Deaths[id]);
    ShowPlayerDialog(playerid, stats, DIALOG_STYLE_MSGBOX, "{f7ea00}Player Statistics:", string, "Okay", "");
    return 1;
}
I don't think there's a problem with this code, but when I go ingame and Type /stats without only it displays the error means this command is being loaded and working half.
Then when i type /stats (id) it says Invalid command! Any idea why? This is happening with all commands I'm adding, though other commmands in the script are working as they should!

Any idea what is causing all this? The other commands in the same script are working fine. Other commands are made by me too, but every command I add now has the same problem
Reply
#2

Make Sure all the Commands are in The Last place, Like not in any callback but in the bottom.
Reply
#3

I think this has nothing to do with the problem, but why are you checking if playerid isn't connected, instead of id?
Reply
#4

Quote:
Originally Posted by Stinged
Посмотреть сообщение
I think this has nothing to do with the problem, but why are you checking if playerid isn't connected, instead of id?
oh will fix it, but is THAT causing it?

And Rudy_ they are in right places bcz the other commands in the script are working
Reply
#5

Oh, i thought he said 'All' the other commands have stopped working.
Reply
#6

anyone?
Reply
#7

Try increasing the string length. Just checked it with a string length tool and its apparently 201 chars long. The max size you've allowed for is 128.
Reply
#8

Quote:
Originally Posted by DobbysGamertag
Посмотреть сообщение
Try increasing the string length. Just checked it with a string length tool and its apparently 201 chars long. The max size you've allowed for is 128.
that didn't fixed my problem!

and new update:
all commands i add works fine without parameter but the moment i use params in it, it stops working and gives uknown command
Reply
#9

anyone deR?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)