Remove user created objects
#6

it doesnt do anything, my script;

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

new pObject[MAX_PLAYERS] = {INVALID_OBJECT_ID, ...};

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	pObject[playerid] = INVALID_OBJECT_ID;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/campfire", cmdtext, true, 10) == 0)
	{
 	new Float:x, Float:y, Float:z;
  	new Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
    if(pObject[playerid] != INVALID_OBJECT_ID) return SendClientMessage(playerid, -1, "You already have an campfire!");
	pObject[playerid] = CreateObject(841, x+5,y,12.5000000,0,0,a); // change the object id
	pObject[playerid] = CreateObject(841, x+5,y,12.5000000,0,0,a); // change the object id
	pObject[playerid] = CreateObject(841, x+5,y,12.5000000,0,0,a); // change the object id
	pObject[playerid] =  CreateObject(3461, x+5,y,11.0000000,0,0,a); // change the object id
	pObject[playerid] =  SendClientMessage(playerid, -1, "You made an campfire!");
	return 1;
	}
	if (strcmp("/removecamp", cmdtext, true, 10) == 0)
	{
		DestroyObject(pObject[playerid]);
		pObject[playerid] = INVALID_OBJECT_ID;
		return 1;
	}
	return 0;
}
Reply


Messages In This Thread
Remove user created objects - by luckie12 - 16.05.2014, 06:46
Re: Remove user created objects - by Lordzy - 16.05.2014, 06:52
Re: Remove user created objects - by luckie12 - 16.05.2014, 06:59
Re: Remove user created objects - by Lordzy - 16.05.2014, 08:17
Re: Remove user created objects - by luckie12 - 16.05.2014, 08:19
Re: Remove user created objects - by luckie12 - 16.05.2014, 16:13
Re: Remove user created objects - by luckie12 - 16.05.2014, 18:27
Re: Remove user created objects - by luckie12 - 17.05.2014, 14:50
Re: Remove user created objects - by Jefff - 17.05.2014, 15:25
Re: Remove user created objects - by luckie12 - 17.05.2014, 16:43

Forum Jump:


Users browsing this thread: 1 Guest(s)