Need fixin'
#1

Can you please fix these. I do not get any errors but when I try to use them it tells me unknown command. Wasted hours making them and they still dont work HELP!!
pawn Код:
if(!strcmp(cmdtext[1],"ban",true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAY, "[!] USAGE: /ban [playerid] [reason]");
return 1;
}
new playa = strval(tmp);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(pAdmin[playerid] >= 1)
{
SendClientMessage(playa, COLOR_RED, "You were banned from the server!");
format(string, sizeof(string), "[!] AdmCmd: %s was banned by %s, Reason: %s",sendername, giveplayer, result);
SendClientMessageToAll(COLOR_ADMIN, string);
Ban(playa);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "[!] You cannot use this command!");
}
return 1;
}
//----------------------------- [ KICK ]----------------------------------------
if(!strcmp(cmdtext[1],"kick",true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAY, "[!] USAGE: /kick [playerid] [reason]");
return 1;
}
new playa = strval(tmp);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(pAdmin[playerid] >= 1)
{
SendClientMessage(playa, COLOR_RED, "You were kicked from the server!");
format(string, sizeof(string), "[!] AdmCmd: %s was kicked by %s, Reason: %s",sendername, giveplayer, result);
SendClientMessageToAll(COLOR_ADMIN, string);
Kick(playa);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "[!] You cannot use this command!");
}
return 1;
}
//------------------------------[ MUTE ]----------------------------------------
if(!strcmp(cmdtext[1],"mute",true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAY, "[!] USAGE: /mute [playerid]");
return 1;
}
new playa = strval(tmp);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(pAdmin[playerid] >= 1 && Muted[playa] == 0)
{
format(string, sizeof(string), "[!] AdmCmd: %s was silenced by %s",giveplayer, sendername);
SendClientMessageToAll(COLOR_ADMIN, string);
Muted[playa] = 1;
return 1;
}
}
else
{
new playa = strval(tmp);
if(pAdmin[playerid] >= 1 && Muted[playa] != 0)
{
format(string, sizeof(string), "[!] AdmCmd: %s was unsilenced by %s",giveplayer, sendername);
SendClientMessageToAll(COLOR_ADMIN, string);
Muted[playa] = 0;
return 1;
}
}
//------------------------------[ SLAP ]----------------------------------------
if(!strcmp(cmdtext[1],"slap",true))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAY, "[!] USAGE: /slap [playerid]");
return 1;
}
new playa = strval(tmp);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(pAdmin[playerid] >= 1)
{
format(string, sizeof(string), "[!] AdmCmd: %s was slapped by %s",giveplayer, sendername);
SendClientMessageToAll(COLOR_ADMIN, string);
new Float:health;
new Float:x, Float:y, Float:z;
GetPlayerHealth(playa, health);
SetPlayerHealth(playa, health-10);
GetPlayerPos(playa, x, y, z);
SetPlayerPos(playa, x, y, z+10);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "[!] You cannot use this command!");
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)