/wisper , /ad (btw izvinjavam se sto ovako puno tema otvaram)

Započeo BLACK, Maj 21, 2009, 14:33:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

ako neko ima isparavan /wisper dali mzoe da mi da posto moj moze na bilo koju razdaljnu a nisam znao kako da na odgovarajuce mesto postavim proxydetect, a /ad ne znam sta je problem igracima koji nisu admin non stop pise molimo sacekajte 60 sec


Correlli


#define COLOR_WHISPER 0xC2A2DAAA




#define dcmd(%1,%2,%3) if((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

Eto ja koristim dcmd, ako ti nepaše onda promijeni u normalno.



dcmd_w(playerid, params[])
{
if(!strlen(params))
{
SendSClientMessage(playerid, COLOR_WHISPER, "correct usage: '/whisper) [text]'");
return 1;
}
else
{
new string[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s whispers: %s", playername, params);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetDistanceBetweenPlayers(playerid, i) < 5)
{
SendClientMessage(i, COLOR_WHISPER, string);
}
}
}
}
return 1;
}


To sam ti nabrzinu napisao, neznam dali radi.. moralo bi.

sad ja sa tim se nisam susrecao, ako mozes da mi das neki oblik koje je ko u gf???

matejdz

Evo ti...

/advertise || /ad

if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste logirani !");
            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, "KORISTITE: (/ad)vertise [text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "   Razmak izmedu oglasa mora biti %d sekundi !",  (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;

}
new payout = idx * 25;
if(GetPlayerMoney(playerid) < payout)
        {
            format(string, sizeof(string), "* Iskoristili ste %d znakova, trebate platiti $%d.", offset, payout);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            return 1;
        }
GivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "Oglas: %s, Kontakt: %s Phone: %d",  result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Platili ste $%d~n~~w~ Oglas je sadrzavao %d znakova", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
return 1;
}


/wisper || /w

if(strcmp(cmd, "/wisper", true) == 0 || strcmp(cmd, "/w", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "  Niste logirani !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTITE: (/w)isper [playerid/PartOfName] [text]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
            new Float:x, Float:y, Float:z;
GetPlayerPos(giveplayerid, x, y, z);
if(PlayerToPoint(5.0, playerid, x, y, z))
{
    if(HidePM[giveplayerid] > 0)
{
        SendClientMessage(playerid, COLOR_GREY, "   Previse ste udaljeni !");
        return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(giveplayerid == playerid)
{
format(string, sizeof(string), "* %s nesto sapce %d.", sendername, giveplayer);
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
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, "KORISTITE: (/w)isper [playerid/PartOfName] [text]");
return 1;
}
format(string, sizeof(string), "%s(ID: %d) sapce: %s", sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Poruka poslana %s(ID: %d).", giveplayer, giveplayerid);
SendClientMessage(playerid,  COLOR_YELLOW, string);
SBizzInfo[2][sbTill] += txtcost / 2;
ExtortionSBiz(2, txtcost / 2);
return 1;
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Previse ste udaljeni !");
}
return 1;
}
}