/smoke help.
#1

Erm.. Hello, i have a basic /smoke scirpt, you buy cigarettes from a store plus as a lighter and smoke them, But i wanted a Cigar to pop up
Iv Seen Many Servers With that, So it looks More Realistice Can Anyone Help Me I Just Need The Script For /smoke so we can smoke them cigerettes
from 24/7 thanks in advance,

Heres My Command From My Script


Code:
	if(!strcmp(cmdtext, "/smoke", true)) 
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(gPlayerLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
	      return 1;
	    }
	    if(IsSmoking[playerid] == 0)
	    {
	      if(PlayerInfo[playerid][pLighter] == 0)
	      {
	        SendClientMessage(playerid, COLOR_GREY, "  You don't have a lighter to light up your cigarette ! ");
	        return 1;
	      }
	      if(PlayerInfo[playerid][pCigarettes] == 0)
	      {
	        SendClientMessage(playerid, COLOR_GREY, "  You don't have a cigarette to smoke ! ");
	        return 1;
	      }
	      new randsmoke = random(2)+1;
				if(randsmoke == 1)
				{
				  PlayerInfo[playerid][pLighter] -= 1;
				  PlayerInfo[playerid][pCigarettes] -= 1;
				  GetPlayerName(playerid, sendername, sizeof(sendername));
				  if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his lighter and cigarette and lights it up.", sendername); }
					else { format(string, sizeof(string), "* %s takes out her lighter and cigarette and lights it up.", sendername); }
				  ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				  IsSmoking[playerid] = 60;
				  SendClientMessage(playerid, COLOR_WHITE, "TIP: You can /dropcigarette anytime you want.");
				  SendClientMessage(playerid, COLOR_WHITE, "TIP: You can use /smokeanim if you want to.");
				  return 1;
				}
				else
				{
				  PlayerInfo[playerid][pLighter] -= 1;
				  GetPlayerName(playerid, sendername, sizeof(sendername));
				  if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his lighter and cigarette and tries to light it up but fails.", sendername); }
					else { format(string, sizeof(string), "* %s takes out her lighter and cigarette and tries to light it up but fails.", sendername); }
   				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				  return 1;
				}
			}
			else
			{
			  SendClientMessage(playerid, COLOR_GREY, "  You are already smoking ! ");
			  return 1;
			}
		}
		return 1;
	}

	if(!strcmp(cmdtext, "/dropcigarette", true))
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(gPlayerLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You need to login first !");
	      return 1;
	    }
	    if(IsSmoking[playerid] > 0)
	    {
	      IsSmoking[playerid] = 0;
	      GetPlayerName(playerid, sendername, sizeof(sendername));
	      if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes a cigarette from his mouth and drops it on the ground.", sendername); }
	      else { format(string, sizeof(string), "* %s takes a cigarette from her mouth and drops it on the ground.", sendername); }
	      ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	      if(UsingSmokeAnim[playerid] == 1)
	      {
	        ClearAnimations(playerid);
	      }
	    }
	    else
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You are not even smoking ! ");
	      return 1;
	    }
		}
		return 1;
	}
Reply
#2

Yo ujust need to put (if succesful bougt etc. )
put:
Code:
SetPlayerSpecialAction(playerid, (new smoke animation name))
(put taht when you are going to light..
Reply
#3

You can see the actions from the WIKI. The ID of the smoking is 21 or SPECIAL_ACTION_SMOKE_CIGGY
Reply
#4

Thanks Fixed Now
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)