zcmd 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)
+--- Thread: zcmd problem? (
/showthread.php?tid=534360)
zcmd problem? -
PMH - 29.08.2014
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
Re: zcmd problem? -
Rudy_ - 29.08.2014
Make Sure all the Commands are in The Last place, Like not in any callback but in the bottom.
Re: zcmd problem? -
Stinged - 29.08.2014
I think this has nothing to do with the problem, but why are you checking if playerid isn't connected, instead of id?
Re: zcmd problem? -
PMH - 29.08.2014
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
Re: zcmd problem? -
Rudy_ - 29.08.2014
Oh, i thought he said 'All' the other commands have stopped working.
Re: zcmd problem? -
PMH - 29.08.2014
anyone?
Re: zcmd problem? -
DobbysGamertag - 29.08.2014
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.
Re: zcmd problem? -
PMH - 29.08.2014
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
Re: zcmd problem? -
PMH - 29.08.2014
anyone deR?