PDA

View Full Version : /AD command


Dark Crow
08/04/2012, 06:02 PM
how can i edit this command so i can make it to be only usable in a certain Interior?
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, WHITE, "("COL_RED"Greska{FFFFFF}!) Ne ste prijaveni!");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, WHITE, "("COL_RED"Greska{FFFFFF}!) Morate da bidete level "COL_RED"3 {FFFFFF}da mozete da dadete oglas.");
return 1;
}
if(!PlayerToPoint(5.0,playerid,1223.4231,-1813.9696,16.5938))
{
SendClientMessage(playerid, WHITE, "("COL_RED"Greska{FFFFFF}!) Da dadete oglas morate da bidete kaj "COL_RED"LSN Studio!");
SetPlayerCheckpoint(playerid,1223.4231,-1813.9696,16.5938,3.0);
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, "Koristi: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "Pocekajte %d sekundi da stavite uste eden oglas!", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;

}
new payout = idx * 1;
if(GetPlayerMoney(playerid) < payout)
{
format(string, sizeof(string), "* Vie iskoristivte %d bukvi cena: $%d, nemate dovoljno pari.", offset, payout);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
GivePlayerCash(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "{48E31C}Oglas | Kontakt: {FFFFFF}%s | {48E31C}Broj: {FFFFFF}%d.",sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "- %s.", result);
OOCNews(COLOR_WHITE,string);
format(string, sizeof(string), "~r~Smetka $%d~n~~w~Oglasot sodrzese: %d Slova", payout, idx);
GameTextForPlayer(playerid, string, 5000, 1);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
return 1;
}

I don't rally know how to make it so i can use it in a certain interior.

Kindred
08/04/2012, 06:09 PM
You mean a position, or an interiorid?


if(IsPlayerInRangeOfPoint(playerid, range(bigenoughforthewholeinterior), posx,posy,posz))
{


if(GetPlayerInterior(playerid) == interior)
{

Etcetra...