Quote:
Originally Posted by Flashy
Firstly: No one will script for you whole commands.
Secondly: What is /b and /o going to do?
Thirdly: Learn to script please if you want to make your own things.
|
Firstly: I would lovely script the cmds to him, so that's wrong.
Secondly: /B is for Local ooc. And /o(oc) is for global OOC.
![wink](images/smilies/wink.gif)
Thirdly: It's logic that he's trying to learn and just asks for help, so he can learn HOW TO do it.
@ Treah
You can learn to make a /me herE:
https://sampwiki.blast.hk/wiki/Using_strcmp()
An /OOC cmd could look like this:
pawn Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You are not logged in.");
return 1;
}
if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " The OOC channel has been disabled.");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak you are muted.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
return 1;
}
format(string, sizeof(string), "(( %s: %s ))", sendername, result);
OOCOff(COLOR_OOC,string);
printf("%s", string);
}
return 1;
}
And to enable and close your OOC code you could do like this:
pawn Код:
if(strcmp(cmd, "/noooc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 3 && (!noooc))
{
noooc = 1;
BroadCast(COLOR_GRAD2, " OOC chat channel disabled by an Admin !");
}
else if (PlayerInfo[playerid][pAdmin] >= 3 && (noooc))
{
noooc = 0;
BroadCast(COLOR_GRAD2, " OOC chat channel enabled by an Admin !");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
And the /b could be like this:
pawn Код:
if(strcmp(cmd, "/b", true) == 0)//local ooc
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /b [local ooc chat]");
return 1;
}
format(string, sizeof(string), "%s Says: (( %s ))", sendername, result);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", string);
}
return 1;
}
I hope you can use some off it. I don't have time explaining now, but you're welcome to PM me if you don't understand it.