// Kicks a player with a reason
COMMAND:kikaj(playerid, params[])
{
new PlayerToKick, Reason[128], ReasonMsg[128], Name[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/kikaj", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "us[128]", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Koristenje: \"/kikaj <Igrac> <Razlog>\"");
else
if (IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he's connected)
{
// Get the name of the player who warned the player
GetPlayerName(playerid, Name, sizeof(Name));
// Send the warned player a message who kicked him and why he's been kicked
format(ReasonMsg, 128, "Izbacen si sa servera od %s %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
format(ReasonMsg, 128, "Razlog: %s", Reason);
SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
// Kick the player
Kick_(PlayerToKick);
}
else
SendClientMessage(playerid, 0xFF0000FF, "Upisani igrac nije online na serveru.");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
// Bans a player for (days, hours, minutes, seconds)
COMMAND:banaj(playerid, params[])
{
// Setup local variables
new PlayerToBan, Days, Hours, Reason[128], TotalBanTime, Msg[128], Name[24], AdminName[24];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/banaj", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 3
if (APlayerData[playerid][PlayerLevel] >= 3)
{
if (sscanf(params, "uiis[128]", PlayerToBan, Days, Hours, Reason))
SendClientMessage(playerid, 0xFF0000AA, "Koristenje: \"/banaj <Igrac> <Dani> <Sati> <Razlog>\"");
else
{
if (IsPlayerConnected(PlayerToBan))
{
// Get the names of the player and the admin who executed the ban
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(PlayerToBan, Name, sizeof(Name));
// Increase the number of bans
APlayerData[PlayerToBan][Bans]++;
// Calculate the total bantime (when the player can login again)
TotalBanTime = (Days * 86400) + (Hours * 3600) + gettime();
// Check if this is the player's 5th ban
if (APlayerData[PlayerToBan][Bans] == 5)
APlayerData[PlayerToBan][BanTime] = 2147483640; // Make the ban permanent (as high as it can go)
else
APlayerData[PlayerToBan][BanTime] = TotalBanTime; // Store this value for the player
// Inform the player about his ban
// Check if this is the player's 5th ban
if (APlayerData[PlayerToBan][Bans] == 5)
{
format(Msg, 128, "Zauvijek si banan sa servera od %s, ovo ti je 5. ban.", AdminName);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
}
else
{
format(Msg, 128, "Banan si sa servera od %s na %i dana i %i sati.", AdminName, Days, Hours);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
format(Msg, 128, "Razlog: %s", Reason);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
format(Msg, 128, "Banan si vec %i puta, peti put je trajno.", APlayerData[PlayerToBan][Bans]);
SendClientMessage(PlayerToBan, 0x808080FF, Msg);
}
// Kick the player (his data will be saved)
Kick_(PlayerToBan);
// Inform everybody else which player was banned and for how long
format(Msg, 128, "%s %s je banao %s na %i dana i %i sati.", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName, Name, Days, Hours);
SendClientMessageToAll(0x808080FF, Msg);
}
}
}
else
return 0;
}
else
return 0;
return 1;
}
COMMAND:srusi(playerid,params[])
{
SendAdminText(playerid, "/srusi", params);
if (APlayerData[playerid][LoggedIn] == true && APlayerData[playerid][PlayerLevel] > 9)
{
new Korisnik;
if(sscanf(params, "u", Korisnik)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}Komanda:{FF0000} {FFFFFF}/Srusi <Nadimak / ID> {FFFFFF}");
GameTextForPlayer(Korisnik, "~k~~INVALID_KEY~", 100, 5);
return 1;
}
return 0;
}
if(APlayerData[PlayerToKick][PlayerLevel] >= 1)
{
SendClientMessage(playerid, -1, "You are not able to kick admins.");
return 1;
}
SendAdminText(playerid, "/kikaj", params);
if(APlayerData[playerid][PlayerLevel] > APlayerData[Korisink][PlayerLevel]
use this
pawn Код:
|
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(628) : error 010: invalid function or declaration C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(631) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.