Team System
#1

Hey Guys i want to make a team system but i am failing to make one i want to make a team named SWAT for Cops And Robbers which should not require any score or anything but it should be added only by admin if admin adds you to swat team than you can spawn as swat otherwise it gives you an error message You are not a Swat Member.

+rep in Advance Please I Need Help.
Reply
#2

I have a SWAT system too. But i disable the skin for players who are NOT a SWAT member.
Reply
#3

But how to make it i want help. Please
Reply
#4

Do you have skype please add me i can give you something in return.

skype: arshman.afzal
Reply
#5

Код:
new swat[MAX_PLAYERS];

public OnPlayerRequestSpawn(playerid) {
if(swat[playerid] == 0) {
if(GetPlayerSkin(playerid) == 285) { SendClientMessage(playerid,-1,"You Must Be A SWAT To Use This Skin"); return 0; }
}
return 1;
}

CMD:setswatpermission(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /setswatpermission [playerid]");
swat[playerid] = 1;
SendClientMessage(playerid,-1,"Swat permission seted.");
} else return SendClientMessage(playerid,-1,"ERROR: You need to be RCON to use this command");
return 1;
}

CMD:takeswatpermission(playerid, params[]) {
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /takeswatpermission [playerid]");
swat[playerid] = 0;
SendClientMessage(playerid,-1,"Swat permission taked.");
} else return SendClientMessage(playerid,-1,"ERROR: You need to be RCON to use this command");
return 1;
}
hope it work :d
FilterScript:
Код:
#include a_samp
#include zcmd

new swat[MAX_PLAYERS];

public OnPlayerRequestSpawn(playerid) {
if(swat[playerid] == 0) {
if(GetPlayerSkin(playerid) == 285) { SendClientMessage(playerid,-1,"You Must Be A SWAT To Use This Skin"); return 0; }
}
return 1;
}

CMD:setswatpermission(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /setswatpermission [playerid]");
swat[playerid] = 1;
SendClientMessage(playerid,-1,"Swat permission seted.");
} else return SendClientMessage(playerid,-1,"ERROR: You need to be RCON to use this command");
return 1;
}

CMD:takeswatpermission(playerid, params[]) {
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /takeswatpermission [playerid]");
swat[playerid] = 0;
SendClientMessage(playerid,-1,"Swat permission taked.");
} else return SendClientMessage(playerid,-1,"ERROR: You need to be RCON to use this command");
return 1;
}
Reply
#6

how will i send message to the player who has been added to swat?
i want to send him message.

---SWAT Leader Has Added You to SWAT---
======Congratulations=======
Reply
#7

old code have bug
the old will set ur own SWAT rank xD
take this:
Код:
#include a_samp
#include zcmd

new swat[MAX_PLAYERS];

public OnPlayerRequestSpawn(playerid) {
if(swat[playerid] == 0) {
if(GetPlayerSkin(playerid) == 285) { SendClientMessage(playerid,-1,"You Must Be A SWAT To Use This Skin"); return 0; }
}
return 1;
}
CMD:setswatpermission(playerid,params[]) {
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /setswatpermission [playerid]");
new player1;
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
else player1 = strval(params);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
swat[player1] = 1;
SendClientMessage(playerid,-1,"Swat permission seted.");
SendClientMessage(player1,-1,"======Congratulations======= ");
SendClientMessage(player1,-1,"---SWAT Leader Has Added You to SWAT---");
} else return SendClientMessage(playerid, -1, "Player is not connected or is yourself");
} else return SendClientMessage(playerid,-1,"ERROR: You need to be RCON to use this command");
return 1;
}

CMD:takeswatpermission(playerid, params[]) {
if(IsPlayerAdmin(playerid)) {
if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /takeswatpermission [playerid]");
new player1;
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
else player1 = strval(params);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
swat[player1] = 0;
SendClientMessage(playerid,-1,"Swat permission taked.");
SendClientMessage(player1,-1,"---SWAT Leader Has Demoted Your SWAT Rank---");
} else return SendClientMessage(playerid, -1, "Player is not connected or is yourself");
} else return SendClientMessage(playerid,-1,"ERROR: You need to be RCON to use this command");
return 1;
}

stock IsNumeric(string[])
{
	for (new i = 0, j = strlen(string); i < j; i++)
	{
		if (string[i] > '9' || string[i] < '0') return 0;
	}
	return 1;
}

stock pName(playerid)
{
  new plname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, plname, sizeof(plname));
  return plname;
}

stock ReturnPlayerID(PlayerName[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(strfind(pName(i),PlayerName,true)!=-1) return i;
		}
	}
	return INVALID_PLAYER_ID;
}
Reply
#8

How Can i save this rank on relog the rank gets removed and needs to be set again.on quitting the server the rank gets lost and needs to be set again Anyone Help PLease.
Reply
#9

Can You Please Help Me. i cant save this rank.
Reply
#10

****** has been released on 1998(16 years ago)why you do not use it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)