[HELP] Pawno Crashes when compiling /ooc
#1

Everytime I'm trying to add the /ooc cmd it just crashes when I try to compile it.
Did I miss something, a include?

I have changed the normal chat radius to 10. In RP (IC Chat).

This is the script:

Код:
if(!strcmp(cmdtext, "/ooc", true) || !strcmp(cmdtext, "/o", true))
{
	new find = strfind(cmdtext, " ", true);
	if(find == -1 || find >= 30) return SendClientMessage(playerid, COLOR_RED, "Right Usage: \"/occ\" or \"/o\" [text]");
	new str[128], pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(str, sizeof(str), "((OOC: %s:%s ))", pname, cmdtext[find+1]);
	return SendClientMessageToAll(COLOR_OOC, str);
}
Reply
#2

This command compiles without any problems for me. I guess the problem is somewhere else.
Reply
#3

You have an unmatched closing brace (Curly Bracket),
Top tip to remember is every Open Curly Bracket({) must have an adjacent Closing Curly Bracket(}) .
Reply
#4

Quote:
Originally Posted by JeNkStAX
You have an unmatched closing brace (Curly Bracket),
Top tip to remember is every Open Curly Bracket({) must have an adjacent Closing Curly Bracket(}) .
Where?
Reply
#5

There's a problem with that command anyway, the way you have it set up is a player can type

"/oocbacon cheese"

and it would say "((OOC: SilentHuntR:cheese ))"


try this
pawn Код:
if(!strcmp(cmdtext,"/ooc ",true,5)||!strcmp(cmdtext,"/o ",true,3))
{
  new find = strfind(cmdtext," ",true);
  if(!cmdtext[find+1])return SendClientMessage(playerid, COLOR_RED, "Right Usage: \"/occ\" or \"/o\" [text]");
  new string[256]; //bite me
  GetPlayerName(playerid,string,sizeof(string));
  format(string,sizeof(string),"((OOC: %s:%s ))", string, cmdtext[find+1]);
  return SendClientMessageToAll(COLOR_OOC, string);
}
Reply
#6

Quote:
Originally Posted by SilentHuntR
There's a problem with that command anyway, the way you have it set up is a player can type

"/oocbacon cheese"

and it would say "((OOC: SilentHuntR:cheese ))"
https://sampwiki.blast.hk/wiki/Strcmp
Reply
#7

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by SilentHuntR
There's a problem with that command anyway, the way you have it set up is a player can type

"/oocbacon cheese"

and it would say "((OOC: SilentHuntR:cheese ))"
https://sampwiki.blast.hk/wiki/Strcmp
Then you're saying it would never work? because "/ooc words" isn't the same as "/ooc"
Reply
#8

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by JeNkStAX
You have an unmatched closing brace (Curly Bracket),
Top tip to remember is every Open Curly Bracket({) must have an adjacent Closing Curly Bracket(}) .
Where?
What?, Think about it, Everytime you use a { you must have an adjacent },
The only exception is if you script like this, But it dosent matter anyway as your using an Closing brace not an Opening brace, (And the fact that IMHO scripting like this is retarded),
pawn Код:
if(bla = blabla)
  print("bla = blabla");
}
Reply
#9

AFter testing all your tips, the editor still crashes, I tested to start a new script, just to make sure it wasn't any error on my old, but it still crashes...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)