if(!strcmp(cmdtext, "/ooc", true,4)){
if(!strlen(cmdtext[4])) SendClientMessage(playerid, 0xffffffff, "USAGE: /ooc [text]");
else {
new tmp[192];
GetPlayerName(playerid,tmp,24);
format(tmp,192,"((OOC - %s: %s))",tmp,cmdtext[5]);
SendClientMessageToAll(0xFFFFFFAA,tmp);
print(tmp);
}
return 1;
}
|
Код:
if(strcmp(cmd, "/b", true) == 0)
{
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[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
return 1;
}
if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "Stranger: (( %s ))", result);
else format(string, sizeof(string), "%s: (( %s ))", sendername, result);
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
}
return 1;
}
|
|
Now why in the world would you post code for a newbie, that obviously won't work? Assuming all the original poster will do is copy/paste, the last thing we need is for him to paste incomplete code into his script, and come back here whining with 1247364178923561487134916234897152378492368 errors.
|