@Roel,every command that requires an id or a playername to take action,is bugged.
pawn Код:
CMD:kick
(playerid,params
[]){ if (PlayerInfo
[playerid
][pAdmin
] >= 1) { new id,n
[MAX_PLAYER_NAME
],reason
[128], on
[MAX_PLAYER_NAME
], string
[256], string2
[256];
new string3
[256];
if(sscanf
(params,
"uz",id, reason
)) return SendClientMessage
(playerid,red,
"Usage:/kick [PlayerID/Name] [reason]");
else if(playerid
== INVALID_PLAYER_ID
) SendClientMessage
(playerid,red,
"System: Invalid ID");
if (id
== INVALID_PLAYER_ID
) return SendClientMessage
(playerid, red,
"System: Invalid ID");
if(playerid
== id
) return SendClientMessage
(playerid,red,
"You cannot kick yourself.");
else { GetPlayerName
(playerid,n,
sizeof(n
));
GetPlayerName
(id,on,
sizeof(on
));
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day
);
gettime(Hour, Minute, Second
);
format(string,
sizeof(string
),
"You have been kicked by Admin %s for: %s - %02d/%02d/%d",n,reason,Day,Month,Year
);
SendClientMessage
(id,red,string
);
format(string2,
sizeof(string
),
"Admin %s (%d) has kicked %s (%d) - Reason: %s - %02d/%02d/%d",n,playerid,on,id,reason,Day,Month,Year
);
SendClientMessageToAll
(red,string2
);
format(string3,
sizeof(string3
),
"*0,4Admin %s (%d) has kicked %s (%d) - Reason: %s - %02d/%02d/%d",n,playerid,on,id,reason,Day,Month,Year
);
IRC_GroupSay
(gGroupID, IRC_CHANNEL, string3
);
IRC_GroupSay
(gGroupID, IRC_ACHANNEL, string3
);
KickLog
(string2
);
Kick
(id
);
TotalAdminKicks
++;
return true;
} } else return 0;
}CMD:ban
(playerid,params
[]){ if (PlayerInfo
[playerid
][pAdmin
] >= 1) { new id,n
[MAX_PLAYER_NAME
],reason
[128], on
[MAX_PLAYER_NAME
], string
[256], string2
[256];
if(sscanf
(params,
"uz",id, reason
)) return SendClientMessage
(playerid,red,
"Usage:/ban [PlayerID/Name] [reason]");
else if(playerid
== INVALID_PLAYER_ID
) SendClientMessage
(playerid,red,
"System: Invalid ID");
if (id
== INVALID_PLAYER_ID
) return SendClientMessage
(playerid, red,
"System: Invalid ID");
if(playerid
== id
) return SendClientMessage
(playerid,red,
"You cannot ban yourself.");
else { GetPlayerName
(playerid,n,
sizeof(n
));
GetPlayerName
(id,on,
sizeof(on
));
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day
);
gettime(Hour, Minute, Second
);
new IP
[16];
new msg
[190];
new str
[128];
GetPlayerIp
(id, IP,
16);
format(string,
sizeof(string
),
"You have been banned by Admin %s for: %s - %02d/%02d/%d",n,reason,Day,Month,Year,Hour
);
SendClientMessage
(id,red,string
);
SendClientMessage
(id,red,
"If you think this is a mistake,post an unban appeal at www.codsamp.net");
format(str,
sizeof(str
),
"banip %s",IP
);
SendRconCommand
(str
);
PlayerInfo
[id
][pBanned
] = 1;
format(string2,
sizeof(string
),
"Admin %s (%d) has banned %s (%d) - Reason: %s - %02d/%02d/%d",n,playerid,on,id,reason,Day,Month,Year
);
SendClientMessageToAll
(COLOR_PINK,string2
);
TotalAdminBans
++;
format(msg,
sizeof(msg
),
"0,4Admin %s has banned %s - Reason: %s - %02d/%02d/%d",n,on,reason,Day,Month,Year
);
IRC_GroupSay
(gGroupID, IRC_CHANNEL, msg
);
IRC_GroupSay
(gGroupID, IRC_ACHANNEL, msg
);
BanLog
(string2
);
Ban
(id
);
return true;
} } else return 0;
}CMD:goto(playerid, params
[]){ if (PlayerInfo
[playerid
][pAdmin
] >= 2) { new targetid, string
[128];
if(sscanf
(params,
"u", targetid
)) return SendClientMessage
(playerid, red,
"Usage: /goto [PlayerID/Name]");
else { new pName
[24];
GetPlayerName
(targetid,pName,
128);
new aName
[24];
GetPlayerName
(playerid,aName,
128);
format(string,
sizeof(string
),
"You succesfully teleported to %s [%d]",pName,targetid
);
SendClientMessage
(playerid,red,string
);
SetPlayerInterior
(playerid,GetPlayerInterior
(targetid
));
new Float:TeleX,
Float:TeleY,
Float:TeleZ;
GetPlayerPos
(targetid, TeleX, TeleY, TeleZ
);
SetPlayerPos
(playerid, TeleX, TeleY, TeleZ
+1);
if(GetPlayerState
(targetid
) == PLAYER_STATE_DRIVER
) { SetVehiclePos
(GetPlayerVehicleID
(targetid
), TeleX, TeleY, TeleZ
+2);
} new msg
[128];
format(msg,
sizeof(msg
),
"0,4Admin %s (%d) has teleported to %s (%d)", aName,playerid, pName, targetid
);
IRC_GroupSay
(gGroupID, IRC_CHANNEL, msg
);
return true;
} } else return 0;
}CMD:drop
(playerid, params
[]){ new pid;
if(sscanf
(params,
"us", pid, params
[2])) return SendClientMessage
(playerid, 0xFF0000AA,
"Usage: /drop [playerid] [reason]");
if (PlayerInfo
[playerid
][pAdmin
] >= 1) { if(!IsPlayerConnected
(pid
)) return SendClientMessage
(playerid, red,
"ERROR: That player is not online.");
new Float:x;
new Float:y;
new Float:z;
new msg
[128];
new adminname
[MAX_PLAYER_NAME
], paramname
[MAX_PLAYER_NAME
], string
[180];
GetPlayerName
(pid, paramname,
sizeof(paramname
));
GetPlayerName
(playerid, adminname,
sizeof(adminname
));
format(string,
sizeof(string
),
"Admin %s (%d) has dropped %s (%d) - Reason: %s", adminname,playerid, paramname, pid, params
[2]);
SendClientMessageToAll
(red, string
);
GetPlayerPos
(pid,x,y,z
);
SetPlayerPos
(pid,x,y,z
+25);
format(msg,
sizeof(msg
),
"0,4Admin %s (%d) has dropped %s (%d) - Reason: %s", adminname,playerid, paramname, pid, params
[2]);
IRC_GroupSay
(gGroupID, IRC_ACHANNEL, msg
);
IRC_GroupSay
(gGroupID, IRC_CHANNEL, msg
);
} else SendClientMessage
(playerid, red,
"Unknown command.");
return 1;
}