[FilterScript] Simple DeathMatch Control
#1

Simple DeathMatch Control

This is simple FilterScript that allows the RCON admin to enable/disable DeathMatching for players
When player DeatMatch someone, it removes all his/her weapons and fines him/her 5000$,
and player who got DeathMatched, he/she gonna respawn at the last place where he/she dead! and refund him/her 5000$

Commands
For RCON Admins
/EnableDM
/DisableDM


Download - Fixed Bugs
Pastebin - : http://pastebin.com/8Kh7yqKR
Code - :
Код:
// DEATHMATCH CONTROL
// THIS SCRIPT MADE BY FRE$HKIDD, IT'S NOT AVALAIBLE TO STEAL THIS SCRIPT!! OR RELEASE IT ANYWHERE!!!!
//

#include <a_samp>
new DM = 1;
new DMed[MAX_PLAYERS];
new Float:pX, Float:pY, Float:pZ;
new Float:DeathPosX[MAX_PLAYERS];
new Float:DeathPosY[MAX_PLAYERS];
new Float:DeathPosZ[MAX_PLAYERS];
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n======================================");
	print("        DEATHMATCH CONTROL By Fre$hKidd    ");
	print("========================================\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" DEATHMATCH CONTROL By Fre$hKidd       ");
	print("----------------------------------\n");
}

#endif

public OnPlayerDeath(playerid, killerid, reason)
{
	if (DM == 0)
	{
		SendClientMessage(killerid,0xFF0000FF,"DeatMatch Isn't Allowed! , you have been forced to remove all your weapons!");
		SendClientMessage(killerid,0xFF0000FF,"And you have been fined 5000$ for DeathMatching");
		GivePlayerMoney(killerid,-5000);
		ResetPlayerWeapons(killerid);
    	GetPlayerPos(playerid, pX, pY, pZ);
	 	DeathPosX[playerid] = pX;
    	DeathPosY[playerid] = pY;
    	DeathPosZ[playerid] = pZ;
		DMed[playerid] = 1;
		return 1;
	}
	return 0;
}

public OnPlayerSpawn(playerid)
{
	if (DMed[playerid] == 1)
	{
	    DMed[playerid] = 0;
	    SendClientMessage(playerid,0xB1C8FBAA,"You have been Re-Spawned on your last place because you were DeathMatched !");
	    SendClientMessage(playerid,0xB1C8FBAA,"Refuned 5000$ !");
	    GivePlayerMoney(playerid, 5000);
	    SetPlayerPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
		SetCameraBehindPlayer(playerid);
		return 1;
	}
	return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/enabledm", cmdtext, true, 10) == 0)
	{
     	if(IsPlayerAdmin(playerid))
		{
		SendClientMessageToAll(0xFF6347AA,"DeathMatch Has been enabled for all!");
		DM = 1;
		return 1;
	}
		return SendClientMessage(playerid,0xFF6347AA,"You aren't RCON Admin !");
	}
	
	if (strcmp("/disabledm", cmdtext, true, 10) == 0)
	{
     	if(IsPlayerAdmin(playerid))
		{
		SendClientMessageToAll(0xFF6347AA,"DeathMatch Has been disabled for all!");
		DM = 0;
		return 1;
	}
		return SendClientMessage(playerid,0xFF6347AA,"You aren't RCON Admin !");
	}
	return 0;
}

// DEATHMATCH CONTROL
// THIS SCRIPT MADE BY FRE$HKIDD, IT'S NOT AVALAIBLE TO STEAL THIS SCRIPT!! OR RELEASE IT ANYWHERE!!!!
//
Bugs
Well i didn't test it yet, because i got no players online to check it
But I'm sure that no bugs is there, if you saw any bug report it please
Posting Mirrors Is allowed
Reply
#2

Its a good one, but can you put a pastebin link as well? Regards.

And I am sure I saw that code somewhere else. Have you based off my filterscript?
Anyways, I don't see the point to put the camera that way in this case.
Reply
#3

Quote:
Originally Posted by admantis
Посмотреть сообщение
Its a good one, but can you put a pastebin link as well? Regards.

And I am sure I saw that code somewhere else. Have you based off my filterscript?
Anyways, I don't see the point to put the camera that way in this case.
1st. Pastebin link added
2nd. Well, I didn't copy anyone of this idea, mabye i was who first made it i guess :/
Reply
#4

cool
Reply
#5

LOL (: Nice one!
Reply
#6

can i use it for my gm(yes you will get credits)

btw.: jantjuh long time no see?
Reply
#7

1st. Pastebin link added
2nd. Well, I didn't copy anyone of this idea, mabye i was who first made it i guess :/
-
I don't mean that. I mean I've made a FS including this.
pawn Код:
#
new Float:DeathPosX[MAX_PLAYERS];
new Float:DeathPosY[MAX_PLAYERS];
new Float:DeathPosZ[MAX_PLAYERS];
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
DeathPosX[playerid] = pX;
DeathPosY[playerid] = pY;
DeathPosZ[playerid] = pZ;
SetPlayerPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
SetPlayerCameraPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+5);
SetPlayerCameraLookAt(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
But IDC really
Reply
#8

Quote:
Originally Posted by admantis
Посмотреть сообщение
1st. Pastebin link added
2nd. Well, I didn't copy anyone of this idea, mabye i was who first made it i guess :/
-
I don't mean that. I mean I've made a FS including this.
pawn Код:
#
new Float:DeathPosX[MAX_PLAYERS];
new Float:DeathPosY[MAX_PLAYERS];
new Float:DeathPosZ[MAX_PLAYERS];
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
DeathPosX[playerid] = pX;
DeathPosY[playerid] = pY;
DeathPosZ[playerid] = pZ;
SetPlayerPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
SetPlayerCameraPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+5);
SetPlayerCameraLookAt(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
But IDC really
well i made DeathPos = Death Position
and pX/Y/Z = PlayerX/Y/Z

and +5 for not being in under the ground lol


Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
can i use it for my gm(yes you will get credits)

btw.: jantjuh long time no see?
Ofcourse you can use it
Reply
#9

Some Bug has been Fixed
Reply
#10

WOw man nice!!!!!!!!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)