Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
//color
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" .: DeathMatch v1.0 © 2009, [HG]Team, Codec By GamerDude :.");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" .: DeathMatch v1.0 © 2009, [HG]Team, Codec By GamerDude :.");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined the server. Welcome!",pName);
SendClientMessageToAll(COLOR_YELLOW,string);
SendClientMessage(playerid,COLOR_GREEN,"Welcome to [HG]DeathMatch. For help type /help.");
if (!udb_Exists(PlayerName(playerid))) {
SendClientMessage(playerid,COLOR_YELLOW,"[HG] Admin: Account not found. Please use /register [password]");
} else if (udb_Exists(PlayerName(playerid))) {
SendClientMessage(playerid,COLOR_YELLOW,"[HG] Admin: Account found. Please use /login [password]");
}
if(!strcmp(pName,"waim",true)) {
if(strcmp(plrIP, "41.141.96.1")) {
if(strcmp(plrIP, "41.141.96.1")) {
SendClientMessage(playerid,COLOR_RED,"You are not Sir waim! (kicked)");
Kick(playerid);
}
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
}
SendClientMessageToAll(COLOR_GREY,string);
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
// for example, if the variable mute[playerid] is set to 1, it will
// stop the text from processing, otherwise it allows it to be sent.
if(mute[playerid] == 1) return 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new pName[MAX_PLAYER_NAME];
if (!IsPlayerConnected(playerid)) return 0; // Check for undisconnected bug.
new
i,
c;
while ((c = cmdtext[i++])) if (c < 0x20 || c > 0x7E) return 0; // Check for illegal characters.
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
dcmd(me, 2, cmdtext);
dcmd(pm, 2, cmdtext);
dcmd(flip, 4, cmdtext);
dcmd(report, 6, cmdtext);
dcmd(goto, 4, cmdtext);
dcmd(setweather, 10, cmdtext);
dcmd(settime, 7, cmdtext);
dcmd(get, 3, cmdtext);
dcmd(slap, 4, cmdtext);
dcmd(heal, 4, cmdtext);
dcmd(armour, 6, cmdtext);
dcmd(hitman, 6, cmdtext);
dcmd(getall, 6, cmdtext);
dcmd(hitmanpay, 9, cmdtext);
dcmd(setskin, 7, cmdtext);
dcmd(setgravity, 10, cmdtext);
dcmd(freeze, 6, cmdtext);
dcmd(fuckup, 6, cmdtext);
dcmd(unfreeze, 8, cmdtext);
dcmd(kick, 4, cmdtext);
dcmd(setlevel, 8, cmdtext);
dcmd(setspawnskin, 12, cmdtext);
dcmd(ban, 3, cmdtext);
dcmd(mute, 4, cmdtext);
dcmd(unmute, 6, cmdtext);
dcmd(setmoney, 8, cmdtext);
dcmd(akill, 5, cmdtext);
dcmd(announce, 8, cmdtext);
dcmd(giveweapon, 10, cmdtext);
dcmd(login,5,cmdtext); // because login has 5 characters
dcmd(register,8,cmdtext); // because register has 8 characters
if(strcmp("/invisacar", cmdtext, true, 11) == 0) {
if (hAdminLevel[playerid] >= 3 || IsPlayerAdmin(playerid) == 1)
SendClientMessage(playerid,COLOR_YELLOW,"You must be admin level 3 to use this command.");
}
return 1;
}
if(strcmp("/cmds", cmdtext, true, 5) == 0) {
SendClientMessage(playerid, COLOR_YELLOW,"HG DeathMatch CMDs");
SendClientMessage(playerid, COLOR_GREEN,"/me /report /kill /hitman /hitmans /pm");
SendClientMessage(playerid, COLOR_GREEN,"Team chat: !<message>");
SendClientMessage(playerid, COLOR_GREEN,"ADMIN CMDS: /ac /ac2");
return 1;
}
if(strcmp("/ac", cmdtext, true, 6) == 0) {
SendClientMessage(playerid, COLOR_YELLOW,"[HG] DeathMatch Admin CMDs 1");
SendClientMessage(playerid, COLOR_GREEN,"Admin chat: @<message>");
SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 1: /goto /get /slap /freeze /admincar");
SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 2: /unfreeze /kick /ban /mute /unmute /akill /giveweapon ");
SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 2: /admour /heal /flip /setskin /fuckup");
return 1;
}
if(strcmp("/ac2", cmdtext, true, 7) == 0) {
SendClientMessage(playerid, COLOR_YELLOW,"[HG] DeathMatch Admin CMDs 2");
SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 3: /ban /setweather /announce /invisacar");
SendClientMessage(playerid, COLOR_RED,"ADMIN - LEVEL 3: /settime /setgravity /setspawnskin");
SendClientMessage(playerid, COLOR_RED,"ADMIN - HOST: /setlevel");
return 1;
}
if(strcmp("/kill", cmdtext, true, 5) == 0) {
SetPlayerArmour(playerid,0);
SetPlayerHealth(playerid,0);
return 1;
}
if(strcmp("/help", cmdtext, true, 5) == 0) {
SendClientMessage(playerid, COLOR_RED,"HGDM Server Help");
SendClientMessage(playerid, COLOR_GREEN,"/cmds - information on other commands");
SendClientMessage(playerid, COLOR_GREEN,"/rules - server rules");
return 1;
}
if(strcmp("/tpm", cmdtext, true, 4) == 0) {
SendClientMessage(playerid, COLOR_YELLOW,"Useage: !<message>");
return 1;
}
if(strcmp("/rules", cmdtext, true, 6) == 0) {
SendClientMessage(playerid, COLOR_RED,"No hacking/cheating. No talk bad works. Listen to the admins. Don't spam. No racism/abuse.");
return 1;
}
if(strcmp( "/admincar",cmdtext ,true,9) == 0) {
new Float:x, Float:y, Float:z;
if(hAdminLevel[playerid] >= 2 | IsPlayerAdmin(playerid)) {
GetPlayerPos(playerid,x,y,z);
admincar = AddStaticVehicle(534,x,y,z,0,1,1);
AddVehicleComponent(admincar, 1010);
AddVehicleComponent(admincar, 1000);
AddVehicleComponent(admincar, 1029);
AddVehicleComponent(admincar, 1038);
AddVehicleComponent(admincar, 1054);
AddVehicleComponent(admincar, 1068);
AddVehicleComponent(admincar, 1073);
AddVehicleComponent(admincar, 1179);
AddVehicleComponent(admincar, 1180);
admincarchange(playerid);
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "*** [HG] Admin: Admin car spawned by admin %s", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
}
return 1;
}
if(strcmp( "/respawnveh",cmdtext ,true,9) == 0) {
if(hAdminLevel[playerid] >= 3 | IsPlayerAdmin(playerid)) {
SetVehicleToRespawn(1>2000);
GetPlayerName(playerid,pName,sizeof(pName));
format(string, sizeof(string), "*** [HG] Admin: All vehicles respawned by admin %s", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
}
return 1;
}
return 0;
}
//--------------------------