This is crashing pawno, help please?
#1

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 ^_^
Reply
#2

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
Reply
#3

https://sampwiki.blast.hk/wiki/Dcmd
https://sampwiki.blast.hk/wiki/Sscanf
https://sampwiki.blast.hk/wiki/Fast_Commands

OnPlayerCommandText()
pawn Код:
dcmd(o,1,cmdtext);
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;
}
Reply
#4

i think its easier than that, i think its brackets, i got it to compile after messing with brackets.
Reply
#5

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.
Reply
#6

Okay okay!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)