[HELP] Booby trap QUICK help !!!
#1

http://forum.sa-mp.com/index.php?topic=158241.0

Could someone help me to make that bomb only buyable to fraction 8? I don't know dcmd that well. That won't take so much time for you. Thank you!
Reply
#2

Check player's team and if player is fac 8 then allow cmd
Reply
#3

But it's built on dcmd ?!?! What is the command in dcmd ?
Reply
#4

Quote:
Originally Posted by Rasmus19
But it's built on dcmd ?!?! What is the command in dcmd ?
show the code il modify it
Reply
#5

Код:
/*
At line number 27 you will find #define BOMBPRICE with the number 300 as default. Change the number 300 to the ammount of cash you want the
Player to pay to place a booby trap in hes current vehicle. Changing the number to 0 will result in the bomb is free!
Note when changing the price you will need to compile every time!


Vehicle Booby Trap system made by Desert 2010. Contact me on www.forum.sa-mp.com with the username Desert.
Do not remove my credits or edit the text above

Regards and enjoy
Desert
*/



#include <a_samp>
#include <dutils>

#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
#pragma unused ret_memcpy
#pragma tabsize 4

#define COLOUR_RED       0xFF3333AA
#define COLOUR_YELLOW     0xFFFF00AA


#define BOMBPRICE 300


#define FILTERSCRIPT

new booby[MAX_VEHICLES];

public OnFilterScriptInit()
{
	print("\n------------------------------------------------------------");
	print("Vehicle Booby Trap Filterscript has been succesfully loaded!");
	print("------------------------------------------------------------\n");
	return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(boobytrap,9,cmdtext);
	return 0;
}

dcmd_boobytrap(playerid,params[])
{
	#pragma unused params
	new vehicle;
	if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOUR_RED,"You need to be in a vehicle to booby trap it!");
	else
	{
	  vehicle = GetPlayerVehicleID(playerid);
	  if(booby[vehicle] == 1) return SendClientMessage(playerid,COLOUR_RED,"This vehicle has already been booby trapped!");
	  {
	    new cash = BOMBPRICE;
	    if(cash > 0)
	    {
				if(GetPlayerMoney(playerid) < BOMBPRICE) return SendClientMessage(playerid,COLOUR_RED,"You do not have money enough for a booby trap!");
				else
				{
			  	SendClientMessage(playerid,COLOUR_YELLOW,"Planted booby trap inside the car!");
			  	PlayerPlaySound(playerid,1057,0,0,0);
			  	GivePlayerMoney(playerid,-BOMBPRICE);
			  	booby[vehicle] = 1;
			  	RemovePlayerFromVehicle(playerid);
			  	GameTextForPlayer(playerid,"~r~Booby trapped",10000,4);
			  	return 1;
			  	}
				}
			else
			{
			  SendClientMessage(playerid,COLOUR_YELLOW,"Planted booby trap inside the car!");
			  PlayerPlaySound(playerid,1057,0,0,0);
			  booby[vehicle] = 1;
			  RemovePlayerFromVehicle(playerid);
			  return 1;
			  }
			}
		}
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate == PLAYER_STATE_DRIVER)
	{
		new vehicle = GetPlayerVehicleID(playerid);
		if(booby[vehicle] == 1)
		{
			new Float:X,Float:Y,Float:Z;
			GetVehiclePos(vehicle,X,Y,Z);
			CreateExplosion(X,Y,Z,7,10);
			PlayerPlaySound(playerid,1057,0,0,0);
			booby[vehicle] = 0;
			SendClientMessage(playerid,COLOUR_RED,"Vehicle has been booby trapped!");
			GameTextForPlayer(playerid,"~r~Booby trapped",10000,4);
			return 1;
			}
		}
	return 1;
}
Reply
#6

IamNotKool? :P
Reply
#7

You should have posted this in my release topic :P

But search (with ctrl+f) for this line dcmd_boobytrap

And add this under #pragma unused params

if(faction[playerid] != return 0;


Or if you use SetPlayerTeam

if(GetPlayerTeam(playerid) != return 0;
Reply
#8

But we use this:

Код:
if (PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) //Hitman
I tried your way but nothing happens

Oh and sorry for not posting into your thread :P I thought you wouldn't read it anyways
Reply
#9

Should look something like this

if(PlayerInfo[playerid][pMember] != 8 && PlayerInfo[playerid] != 8 ) return 0;

Should work


E: Rofl pwning sunglass smiley
Reply
#10

It didin't work, neither FS or adding to the script

What might be the problem?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)