PDA

View Full Version : make Filterscript only cops


vn007322815
09/10/2013, 03:34 PM
I do not know how this scrip can only use the police

#include <a_samp>

// Filterscript Settings

#define TAZE_WEAPON 23 // The weapon the tazer needs to be attached to.
#define TAZE_TIMER 8000 // The time needed to be spent until the criminal automatically gets up.
#define TAZE_SPARK 18717 // The objectid of the spark (It's recommended you don't change this...)
#define TAZE_DESTROY 1050 // The time needed to be spent until the spark dissappears.
#define TAZE_LOSEHP 0 // Set to 1 if you want the victim to lose health when shot. Set 0 or any
// other value if you want the victim not to lose health.

//

new Tazer[MAX_PLAYERS];
new Spark[MAX_PLAYERS];
new Tazed[MAX_PLAYERS];

forward DestroySpark(playerid);
forward TazedRemove(playerid);

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Reachless' Tazer System v0.3");
print("--------------------------------------\n");
return 1;
}

public OnPlayerConnect(playerid)
{
Tazed[playerid] = 0;
Tazer[playerid] = 0;
return 1;
}

public DestroySpark(playerid)
{
DestroyObject(Spark[playerid]);
return 1;
}

public TazedRemove(playerid)
{
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
Tazed[playerid] = 0;
return 1;
}

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
if(Tazer[playerid] == 1 && GetPlayerWeapon(playerid) == TAZE_WEAPON)
{
new Float:health,losehp;
GetPlayerHealth(damagedid,health);
losehp = TAZE_LOSEHP;
if(Tazed[damagedid] == 1) return 1;
new Float:x, Float:y, Float:z;
GetPlayerPos(damagedid, x, y, z);
ClearAnimations(damagedid);
ApplyAnimation(damagedid,"PED","KO_skid_front",4.1,0,1,1,1,0);
Spark[damagedid] = CreateObject(TAZE_SPARK, x, y, z-3, 0, 0, 0);
SetTimerEx("DestroySpark", TAZE_DESTROY, 0, "i", damagedid);
SetTimerEx("TazedRemove", TAZE_TIMER, 0, "i", damagedid);
//TogglePlayerControllable(damagedid, 0);
Tazed[damagedid] = 1;
if(losehp) {} else SetPlayerHealth(damagedid, health+amount);
}
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/on", cmdtext, true, 6) == 0)
{
GivePlayerWeapon(playerid, TAZE_WEAPON, 100);
return 1;
}
if (strcmp("/off", cmdtext, true, 6) == 0)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Tazer[playerid] == 0)
{
if(GetPlayerWeapon(playerid) == TAZE_WEAPON) {} else return SendClientMessage(playerid, 0xFFFFFFFF, "{DC0C0C}Tazer: {FFFFFF}You need to attach the tazer to a Silenced Pistol.");
Tazer[playerid] = 1;
format(string, sizeof(string), "{DC0C0C}Tazer: {FFFFFF}Da Bat Chuc Nang Phong Dien, %s.", sendername);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
else if(Tazer[playerid] == 1)
{
Tazer[playerid] = 0;
format(string, sizeof(string), "{DC0C0C}Tazer: {FFFFFF}Da Tat Chuc Nang Phong Dien, %s.", sendername);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
else Tazer[playerid] = 0;
return 1;
}
return 0;
}


pls help me :(

Jankingston
09/10/2013, 03:37 PM
just put - IsACop


or pm me...i will edit this script

Konstantinos
09/10/2013, 03:37 PM
You'll need to add it to the mode which uses the police stuff.

You'll also need to check if they're cops before using the commands etc.

PS: Don't forget to give credit to the author of it! :)

Lajko1
09/10/2013, 04:12 PM
stock IsPlayerCop(playerid)
{
if(IsPlayerConnected(playerid))
{
GetPlayerSkin(playerid);
new copskin = GetPlayerSkin(playerid);
if( (copskin == 280) || (copskin == 71) || (copskin == 281) || (copskin == 284) || (copskin == 283) || (copskin == 265) || (copskin == 266) || (copskin == 267) || (copskin == 282) || (copskin == 190) || (copskin == 165) || (copskin == 285)||(copskin ==166))
{
return 1;
}
}
return 0;
}

and at commands add this:

if (!IsPlayerCop(playerid)) return SendClientMessage(playerid .... your message);

vn007322815
09/10/2013, 05:23 PM
stock IsPlayerCop(playerid)
{
if(IsPlayerConnected(playerid))
{
GetPlayerSkin(playerid);
new copskin = GetPlayerSkin(playerid);
if( (copskin == 280) || (copskin == 71) || (copskin == 281) || (copskin == 284) || (copskin == 283) || (copskin == 265) || (copskin == 266) || (copskin == 267) || (copskin == 282) || (copskin == 190) || (copskin == 165) || (copskin == 285)||(copskin ==166))
{
return 1;
}
}
return 0;
}

and at commands add this:

if (!IsPlayerCop(playerid)) return SendClientMessage(playerid .... your message);

can't compile

vn007322815
09/10/2013, 06:29 PM
pls help me :(

[EnErGyS]KING
09/10/2013, 06:40 PM
F**king unbelievable copy pasta method over here
#include <a_samp>

// Filterscript Settings

#define TAZE_WEAPON 23 // The weapon the tazer needs to be attached to.
#define TAZE_TIMER 8000 // The time needed to be spent until the criminal automatically gets up.
#define TAZE_SPARK 18717 // The objectid of the spark (It's recommended you don't change this...)
#define TAZE_DESTROY 1050 // The time needed to be spent until the spark dissappears.
#define TAZE_LOSEHP 0 // Set to 1 if you want the victim to lose health when shot. Set 0 or any
// other value if you want the victim not to lose health.

//

new Tazer[MAX_PLAYERS];
new Spark[MAX_PLAYERS];
new Tazed[MAX_PLAYERS];

forward DestroySpark(playerid);
forward TazedRemove(playerid);

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Reachless' Tazer System v0.3");
print("--------------------------------------\n");
return 1;
}
stock IsPlayerCop(playerid)
{
if(IsPlayerConnected(playerid))
{
GetPlayerSkin(playerid);
new copskin = GetPlayerSkin(playerid);
if( (copskin == 280) || (copskin == 71) || (copskin == 281) || (copskin == 284) || (copskin == 283) || (copskin == 265) || (copskin == 266) || (copskin == 267) || (copskin == 282) || (copskin == 190) || (copskin == 165) || (copskin == 285)||(copskin ==166))
{
return 1;
}
}
return 0;
}
public OnPlayerConnect(playerid)
{
Tazed[playerid] = 0;
Tazer[playerid] = 0;
return 1;
}

public DestroySpark(playerid)
{
DestroyObject(Spark[playerid]);
return 1;
}

public TazedRemove(playerid)
{
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
Tazed[playerid] = 0;
return 1;
}

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
if(Tazer[playerid] == 1 && GetPlayerWeapon(playerid) == TAZE_WEAPON)
{
new Float:health,losehp;
GetPlayerHealth(damagedid,health);
losehp = TAZE_LOSEHP;
if(Tazed[damagedid] == 1) return 1;
new Float:x, Float:y, Float:z;
GetPlayerPos(damagedid, x, y, z);
ClearAnimations(damagedid);
ApplyAnimation(damagedid,"PED","KO_skid_front",4.1,0,1,1,1,0);
Spark[damagedid] = CreateObject(TAZE_SPARK, x, y, z-3, 0, 0, 0);
SetTimerEx("DestroySpark", TAZE_DESTROY, 0, "i", damagedid);
SetTimerEx("TazedRemove", TAZE_TIMER, 0, "i", damagedid);
//TogglePlayerControllable(damagedid, 0);
Tazed[damagedid] = 1;
if(losehp) {} else SetPlayerHealth(damagedid, health+amount);
}
return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/on", cmdtext, true, 6 && !IsPlayerCop(playerid)) == 0)
{
GivePlayerWeapon(playerid, TAZE_WEAPON, 100);
return 1;
}
if (strcmp("/off", cmdtext, true, 6 && !IsPlayerCop(playerid)) == 0)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(Tazer[playerid] == 0)
{
if(GetPlayerWeapon(playerid) == TAZE_WEAPON) {} else return SendClientMessage(playerid, 0xFFFFFFFF, "{DC0C0C}Tazer: {FFFFFF}You need to attach the tazer to a Silenced Pistol.");
Tazer[playerid] = 1;
format(string, sizeof(string), "{DC0C0C}Tazer: {FFFFFF}Da Bat Chuc Nang Phong Dien, %s.", sendername);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
else if(Tazer[playerid] == 1)
{
Tazer[playerid] = 0;
format(string, sizeof(string), "{DC0C0C}Tazer: {FFFFFF}Da Tat Chuc Nang Phong Dien, %s.", sendername);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
else Tazer[playerid] = 0;
return 1;
}
return 0;
}

Write if it is good f***ing copy-pasters