SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/04/2012, 06:02 PM   #1
Dark Crow
Big Clucker
 
Join Date: Feb 2012
Posts: 89
Reputation: 0
Default /AD command

how can i edit this command so i can make it to be only usable in a certain Interior?
Code:
    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.
Dark Crow is offline   Reply With Quote
Old 08/04/2012, 06:09 PM   #2
Kindred
High-roller
 
Join Date: Aug 2011
Posts: 1,252
Reputation: 504
Default Re: /AD command

You mean a position, or an interiorid?

pawn Code:
if(IsPlayerInRangeOfPoint(playerid, range(bigenoughforthewholeinterior), posx,posy,posz))
{
pawn Code:
if(GetPlayerInterior(playerid) == interior)
{

Etcetra...
Kindred is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Command Bugged] Each time i use /respawnallcars it says Unknown Command Rand_Omar Scripting Help 11 30/09/2012 12:35 AM
Executed ZCMD command returns SERVER: Unknown Command SexTourist Scripting Help 12 03/01/2012 03:38 PM
Slap command returns an Unknown Command when player is not connected HydraX Help Archive 16 01/08/2011 05:19 AM
SERVER: Unknown Command when using a scripted command and it does execute! Moustafa Help Archive 6 11/06/2010 01:34 PM
SERVER: Unknown Command - after login on every command virtualmarc Help Archive 0 20/09/2009 06:27 PM


All times are GMT. The time now is 04:02 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.