[POMOC] /b

Započeo S!lj0, Septembar 08, 2012, 18:49:00 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

S!lj0

Skripta koju koristim: Svoju od 0
Detaljan opis problema: Potrebna mi je komanda /b
Dio skripte: //
Neke slike/video za lakse dobivanje pomoci(neobavezno): //

Evo ti ;D
if(strcmp(cmd, "/b", true) == 0)// /bb
{
    if(IsPlayerConnected(playerid))
    {
        new text[128];
    for(new i; i < sizeof(ZabranjeneReci); i++)
{
if(strfind(text, ZabranjeneReci[i], true) != -1)
{
  new string2[128];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
  format(string2, sizeof(string2), "[!!!] %s(ID: %d): %s",playername2,playerid,text);
    ABroadCast(0x586433FF,string,1);
}
}

        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "Niste se prijavili !");
            return 1;
        }
        if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, ""COL_RED"|Ime Servera | {FFFFFF}Utisani ste, ne mozete koristiti chat! !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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, "Koriscenje: /b [lokalni ooc chat]");
return 1;
}
new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
for(new b = 0; b < sizeof brojevi; b++)
{
new tekst = strlen(result);
for(new i = 0; i<tekst; i++)
{
if(result[i] == brojevi[b])
result[i] = '*' ;
}
}
if(PlayerInfo[playerid][pMaskuse] == 1)
{
    format(string, sizeof(string), "(( Maskirana osoba kaze: %s ))", result);
}
else
{
format(string, sizeof(string), "(( %s kaze: %s ))", sendername, result);
}
ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
printf("%s", string);
}
return 1;
}

Capetroon.

A ako koristi ZCMD, a ako nema ovih tvojih boja?

A tebi bi bilo bolje da ne pises u teme bezveze, ovde covjek trazi pomoc a ne nekog da pametuje

Capetroon.

Pa ako je tražio pomoć dobro proćitaj svoj post i shvatit ćeš da će dobiti više greški prije nego što je krenuo. :S

S!lj0

Imam ja komandu ali ne radi,pa sam napisao temu da mi neko posalje

Ako ti ne radi mozda ti ne radi Sscanf , a ovo sto ti ovaj dole govori je ne tacno zato sto ti nemas za maskiranje i to.
ODSUTAN



CMD:b(playerid, params[])
{
    if(isnull(params)) return SCM(playerid,-1,"Koriscenje: /b [lokalni ooc chat]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string, sizeof(string), "(( %s: %s ))", sendername, params);
    ProxDetector(30.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
return 1;
}


Sad gore ako nemas definisi #define SCM SendClientMessage pa dodaj i ovo ako nemas stock strreplace(string[], find, replace)
{
    for(new i=0; string[i]; i++)
    {
        if(string[i] == find)
        {
            string[i] = replace;
        }
    }
}

stock GetName(playerid)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace(name, '_', ' ');
    return name;
}
i ovo xD stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
new invehicle[MAX_PLAYERS];
new virtualworld = GetPlayerVirtualWorld(playerid);
new interior = GetPlayerInterior(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
new ivehicleid;
if(vehicleid)
{
GetVehiclePos(vehicleid,oldposx,oldposy,oldposz);
}
else
{
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
vehicleid = GetPlayerVehicleID(playerid);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(!BigEar[i])
    {
if(GetPlayerVirtualWorld(i) == virtualworld)
{
if((GetPlayerInterior(i) == interior))
{
    if(vehicleid)
    {
    if(IsPlayerInVehicle(i,vehicleid)) invehicle[i] = 1;
}
if(!invehicle[i])
{
    if(IsPlayerInAnyVehicle(i))
{
    ivehicleid = GetPlayerVehicleID(i);
    GetVehiclePos(ivehicleid,posx,posy,posz);
}
else
{
    GetPlayerPos(i,posx,posy,posz);
}
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) SCM(i, col1, string);
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SCM(i, col2, string);
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SCM(i, col3, string);
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SCM(i, col4, string);
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SCM(i, col5, string);
}
else SCM(i, col1, string);
}
}
}
else SCM(i, col1, string);
}
}
}
return 1;
}

stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
new invehicle[MAX_PLAYERS];
new virtualworld = GetPlayerVirtualWorld(playerid);
new interior = GetPlayerInterior(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
new ivehicleid;
if(vehicleid)
{
GetVehiclePos(vehicleid,oldposx,oldposy,oldposz);
}
else
{
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
vehicleid = GetPlayerVehicleID(playerid);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(!BigEar[i])
    {
if(GetPlayerVirtualWorld(i) == virtualworld)
{
if((GetPlayerInterior(i) == interior))
{
    if(vehicleid)
    {
    if(IsPlayerInVehicle(i,vehicleid)) invehicle[i] = 1;
}
if(!invehicle[i])
{
    if(IsPlayerInAnyVehicle(i))
{
    ivehicleid = GetPlayerVehicleID(i);
    GetVehiclePos(ivehicleid,posx,posy,posz);
}
else
{
    GetPlayerPos(i,posx,posy,posz);
}
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) SCM(i, col1, string);
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) SCM(i, col2, string);
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) SCM(i, col3, string);
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) SCM(i, col4, string);
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) SCM(i, col5, string);
}
else SCM(i, col1, string);
}
}
}
else SCM(i, col1, string);
}
}
}
return 1;
}
-----> Medju stockove

CMD:b(playerid,params[])
{
    if(isnull(params)) return SCM(playerid, COLOR_SYNTAX,"[CMD]: /b [lokalni ooc chat]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string, sizeof(string), "((%s: %s ))", sendername, params);
    ProxDetector(30.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}
Ovako ce ti sigurno raditi.
I dodaj ove boje :
#define COLOR_FADE1       0xE6E6E6E6
#define COLOR_FADE2       0xC8C8C8C8
#define COLOR_FADE3       0xAAAAAAAA
#define COLOR_FADE4       0x8C8C8C8C
#define COLOR_FADE5       0x6E6E6E6E
#define COLOR_PURPLE       0xC2A2DAAA
#define COLOR_GREY          0xAFAFAFAA
#define COLOR_SYNTAX        0xFFFFFFFF

EDIT : Nikola brzi :P
Poslednja Izmena: Septembar 09, 2012, 10:20:50 PRE PODNE od Daniel Zero
ODSUTAN