PDA

View Full Version : Team System


xXxThunderxXx
02/08/2015, 02:20 PM
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.

Karan007
02/08/2015, 02:28 PM
I have a SWAT system too. But i disable the skin for players who are NOT a SWAT member.

xXxThunderxXx
02/08/2015, 02:34 PM
But how to make it i want help. Please

xXxThunderxXx
02/08/2015, 02:43 PM
Do you have skype please add me i can give you something in return.

skype: arshman.afzal

jlalt
02/08/2015, 02:50 PM
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;
}

xXxThunderxXx
02/08/2015, 03:23 PM
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=======

jlalt
02/08/2015, 03:41 PM
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;
}

xXxThunderxXx
07/08/2015, 06:14 PM
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.

xXxThunderxXx
08/08/2015, 10:03 AM
Can You Please Help Me. i cant save this rank.

PowerF
08/08/2015, 01:40 PM
****** has been released on 1998(16 years ago)why you do not use it?

xXxThunderxXx
15/08/2015, 11:48 AM
PowerF If you cant help someone just move your ass out and i searched on the ****** but found no solution i think this topic is named Scripting Help so i posted here for help Nigger.

Anyone Please help me i still didnt got any solution for saving the swat status mentioned up by jlalt.

xXxThunderxXx
15/08/2015, 04:34 PM
anyone?

Rog
15/08/2015, 04:46 PM
u need to save
use saving system

xXxThunderxXx
15/08/2015, 06:16 PM
im trying to save but i am getting some errors;