SA-MP Forums Archive
[HELP] Pawno Crashes when compiling /ooc - 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: [HELP] Pawno Crashes when compiling /ooc (/showthread.php?tid=78408)



[HELP] Pawno Crashes when compiling /ooc - Littleman774 - 19.05.2009

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);
}



Re: [HELP] Pawno Crashes when compiling /ooc - Correlli - 19.05.2009

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


Re: [HELP] Pawno Crashes when compiling /ooc - ICECOLDKILLAK8 - 19.05.2009

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


Re: [HELP] Pawno Crashes when compiling /ooc - MenaceX^ - 19.05.2009

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?


Re: [HELP] Pawno Crashes when compiling /ooc - Joe Staff - 19.05.2009

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);
}



Re: [HELP] Pawno Crashes when compiling /ooc - MenaceX^ - 19.05.2009

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


Re: [HELP] Pawno Crashes when compiling /ooc - Joe Staff - 19.05.2009

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"


Re: [HELP] Pawno Crashes when compiling /ooc - ICECOLDKILLAK8 - 19.05.2009

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");
}



Re: [HELP] Pawno Crashes when compiling /ooc - Littleman774 - 19.05.2009

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...