Simple questions - 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: Simple questions (
/showthread.php?tid=250548)
Simple questions -
Andregood - 23.04.2011
How do I actually make a /b and /o command?
I'd appreciate it if somebody told me, thanks.
Re: Simple questions -
PCheriyan007 - 23.04.2011
pawn Код:
if(strcmp(cmdtext,"/b", true) == 0)
{
//whatever /b does
}
if(strcmp(cmdtext,"/o", true) == 0)
{
//whatever /o does
}
Re: Simple questions -
Andregood - 23.04.2011
Of course I know that? I mean, how do I MAKE IT, I mean, what to use?
Re: Simple questions -
CrazyBlob - 23.04.2011
what do you want them to do?
Re: Simple questions -
Laronic - 23.04.2011
Thanks for giving so much information about what the commands should do.
pawn Код:
if(strcmp(cmdtext,"/b", true) == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "b");
}
if(strcmp(cmdtext,"/o", true) == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "o");
}
Re: Simple questions -
Andregood - 23.04.2011
Oh my fault for not including that, I'm so sorry. Ehm.. Well I basically want them for OOC purposes on a roleplay server. But I'm not quite certain what to use within the command to create it.
Re: Simple questions -
Laronic - 23.04.2011
Well, i dont really know what OCC does xD but ehh.
pawn Код:
if(strcmp(cmdtext,"/b", true) == 0)
{
new text[128];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /b (text)");
{
format(string,sizeof(string),"[B]: %s", text);
SendClientMessageToAll(0xFFFFFFAA, string);
}
return 1;
}
if(strcmp(cmdtext,"/o", true) == 0)
{
new text[128];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /o (text)");
{
format(string,sizeof(string),"[O]: %s", text);
SendClientMessageToAll(0xFFFFFFAA, string);
}
return 1;
}
Re: Simple questions -
linuxthefish - 23.04.2011
Quote:
Originally Posted by CyberGhost
Thanks for giving so much information about what the commands should do.
pawn Код:
if(strcmp(cmdtext,"/b", true) == 0) { SendClientMessage(playerid, 0xFF0000FF, "b"); }
if(strcmp(cmdtext,"/o", true) == 0) { SendClientMessage(playerid, 0xFF0000FF, "o"); }
|
I lol'd at this!
Re: Simple questions -
Andregood - 23.04.2011
The /b is basically local but the /o is correct I guess, thanks for that. But I do prefer learning over copying straight off, thanks.
Re: Simple questions -
xir - 23.04.2011
I created a cmd with zcmd & sscanf, are you sure you don't want it in zcmd & sscanf instead of strcmp?
Note: You cannot use zcmd & strcmp at the same time