/warn and /deletewarns Commands +REP -
Youssef214 - 24.06.2014
can anyone tell me how to make /warn and /deletewarns commands please? and explain to me how to make one.
I use this variable:
pawn Код:
PlayerInfo[playerid][pAdmin]
For admin levels.
Re: /warn and /deletewarns Commands +REP -
Vanter - 24.06.2014
comment deleted..
Re : /warn and /deletewarns Commands +REP -
Clad - 24.06.2014
pawn Код:
if(strcmp(cmd, "/warn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /warn [id] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= AdminLevel)
{
Re: /warn and /deletewarns Commands +REP -
Youssef214 - 24.06.2014
well i know the basics,but i need someone give me an example of warn command and deletewarns and explain
Re : /warn and /deletewarns Commands +REP -
Clad - 24.06.2014
Give player warn.
pawn Код:
PlayerInfo[giveplayerid][pWarned] = 1;
So admins doesn't do this on higher level.
pawn Код:
new targetlevel = PlayerInfo[giveplayerid][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* You can not ban People that is higher Than You!");
Re: /warn and /deletewarns Commands +REP -
Youssef214 - 24.06.2014
thanks clad for helping me
Re : Re: /warn and /deletewarns Commands +REP -
Clad - 24.06.2014
Quote:
Originally Posted by Youssef214
thanks clad for helping me
|
You're welcome
.
Re: /warn and /deletewarns Commands +REP -
Juvanii - 24.06.2014
Simple command of warning with kick able.
pawn Код:
new Warnings[MAX_PLAYERS]; //on top of your script
CMD:warn(playerid, params[])
{
new targetid, reason[128], string[128];
if(PlayerInfo[playerid][pAdmin] == 0) return 0;
if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, -1, "/warn [playerid/name] [reason]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "This player is not connected.");
if(targetid == playerid) return SendClientMessage(playerid,-1,"You cannot use this command on yourself.");
if(Warnings[targetid] < 4)
{
Warnings[targetid] ++;
format(string, sizeof(string), "%s(%d) has been Warned by an Administrator, reason: %s", GetName(targetid), targetid, reason);
SendClientMessageToAll(-1, string);
}
else //if warning = 5 it will kick player id
{
format(string, sizeof(string), "%s(%d) Has Been Kicked From The Server,t reason: so much warnings", GetName(targetid), targetid);
SendClientMessageToAll(-1, string);
Kick(targetid);
}
return 1;
}
Re : Re: /warn and /deletewarns Commands +REP -
Clad - 24.06.2014
Quote:
Originally Posted by Juvanii
Simple command of warning with kick able.
pawn Код:
new Warnings[MAX_PLAYERS]; //on top of your script
CMD:warn(playerid, params[]) { new targetid, reason[128], string[128]; if(PlayerInfo[playerid][pAdmin] == 0) return 0; if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, -1, "/warn [playerid/name] [reason]"); if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "This player is not connected."); if(targetid == playerid) return SendClientMessage(playerid,-1,"You cannot use this command on yourself.");
if(Warnings[targetid] < 4) { Warnings[targetid] ++; format(string, sizeof(string), "%s(%d) has been Warned by an Administrator, reason: %s", GetName(targetid), targetid, reason); SendClientMessageToAll(-1, string); } else //if warning = 5 it will kick player id { format(string, sizeof(string), "%s(%d) Has Been Kicked From The Server,t reason: so much warnings", GetName(targetid), targetid); SendClientMessageToAll(-1, string); Kick(targetid); } return 1; }
|
First of all he got his help and you don't need to re-bump it, You could answer to others.
Second, Copying a cmd from a gamemode you have downloaded won't help him to learn at all.
Re: Re : Re: /warn and /deletewarns Commands +REP -
Juvanii - 24.06.2014
Quote:
Originally Posted by Clad
First of all he got his help and you don't need to re-bump it, You could answer to others.
Second, Copying a cmd from a gamemode you have downloaded won't help him to learn at all.
|
1. If he got a help, it doesn't mean that no one can help him more.
2. I made this command by myself and i use it in my server. i'm scripter since 2012 and haven't downloaded any gamemodes in my life.
3. If it's from a gamemode, i would put the credits for people whom made this command.
4. Why are you so mad like this? go and have a beer.