This is crashing pawno, help please? - 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: This is crashing pawno, help please? (
/showthread.php?tid=93583)
This is crashing pawno, help please? -
Memoryz - 25.08.2009
Okay, so I ended up writing a small and little OOC chat thingy, but now it crashes Pawno.
This is it:
pawn Код:
if(strcmp(cmd, "/o", true) == 0 || strcmp(cmd, "/ooc", true) == 0)
{
format(string, sizeof(string), "OOC: %s: %s", GetPlayerNameEx(playerid), result);
SendClientMessageToAll(COLOR_BLUE,string);
}
return 1;
}
Can someone please help fix this?
Or atleast write a new one?
I fail at these ^_^
Re: This is crashing pawno, help please? -
cozza123456 - 26.08.2009
I think its brackets,
Код:
if(strcmp(cmd, "/o", true) == 0 || strcmp(cmd, "/ooc", true) == 0)
{
format(string, sizeof(string), "OOC: %s: %s", GetPlayerNameEx(playerid), result);
SendClientMessageToAll(COLOR_BLUE,string);
return 1;
}
Try that but mess with indentation
Re: This is crashing pawno, help please? -
woot - 26.08.2009
https://sampwiki.blast.hk/wiki/Dcmd
https://sampwiki.blast.hk/wiki/Sscanf
https://sampwiki.blast.hk/wiki/Fast_Commands
OnPlayerCommandText()
Somewhere in your source (not in a function)
pawn Код:
dcmd_o(playerid, params[])
{
new txt[128], string[128];
if (sscanf(params,"s", txt)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /o [text]");
if (strlen(txt) > 128) return SendClientMessage(playerid, 0xFFFFFFAA, "WARNING: Your input cannot be longer then 128 characters.");
format(string, sizeof(string), "OOC: %s: %s", GetPlayerNameEx(playerid), txt);
SendClientMessageToAll(COLOR_BLUE,string);
return 1;
}
Re: This is crashing pawno, help please? -
cozza123456 - 26.08.2009
i think its easier than that, i think its brackets, i got it to compile after messing with brackets.
Re: This is crashing pawno, help please? -
woot - 26.08.2009
Quote:
Originally Posted by XxCozzaxX
i think its easier than that, i think its brackets, i got it to compile after messing with brackets.
|
No, just no. That code is useless, doesn't do anything, you didn't define what result is, it definately will not work.
Re: This is crashing pawno, help please? -
cozza123456 - 26.08.2009
Okay okay!