/Warn Command!
5 posters
Page 1 of 1
/Warn Command!
Hey there Ryan... I know you don't have that much of time to add commands, so guess what? I helped you make /warn command, its working great,no bugs found, its very nice!! Here, put it before /kick command.
Just copy it and paste it before the /kick command.
- Code:
//--------------------------------------[Warn]----------------------------------------------------
if(strcmp(cmd, "/warn", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /warn [playerid/PartOfName] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /warn [playerid/PartOfName] [reason]");
return 1;
}
format(string, sizeof(string), "You warned %s, reason: %s", giveplayer, (result));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "You were warned by %s, reason: %s", sendername, (result));
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "AdmWarn: %s has been warned by %s, reason: %s", giveplayer, sendername, (result));
ABroadCast(COLOR_YELLOW,string,1);
return 1;
}
}//not connected
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
Just copy it and paste it before the /kick command.
AndyF- Moderator
- Number of posts : 223
Age : 32
Location : New York,USA
In-Game Name : Andy_Fernandos
Points :
Registration date : 2008-11-29
Re: /Warn Command!
Would be a great help to some nub players around the server.
Insignia- nOOb KiLLeR
- Number of posts : 183
Age : 35
Location : Philippines
In-Game Name : Mario_Conti
Points :
Registration date : 2008-12-22
Re: /Warn Command!
/Locked Suggestion granted approval.
XhizorZ- Be Amazed by my Logic!
Teh OwneR - Number of posts : 490
Age : 37
Location : Amsterdam
In-Game Name : Victor_Gonzales
Points :
Registration date : 2008-11-24
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|