11.06.2012, 11:41
Код:
#include <a_samp>
#include <a_mysql>
#include <foreach>
#include <rBits>
#include <YSI\y_commands>
#define ClearChat() for(new l; l < 30; l++) SendClientMessageToAll(-1, " ")
#define ClearChatForPlayer(%0) for(new l; l < 30; l++) SendClientMessage(%0, -1, " ")
#define VERSION "1.0.0"
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LIME 0x10F441AA
#define COLOR_KRED 0xFF0000FF
#define COLOR_RED 0xAA3333AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_LIGHTBLUE 0x6DC5F3FF
#define COLOR_BLUE 0x2641FEAA
//Current dialog ID: 9 | Always increase this when you add new dialog!
new Query[1000], Float: Pos[4], text2[256], title[128], string[128], string2[128], Text3D: Duty[MAX_PLAYERS], IsChatOnOrOff;
new MuteTimer[MAX_PLAYERS], JailTimer[MAX_PLAYERS];
new Text: BanBox, Text: BanName, Text: BanAdministrator, Text: BanReason;
new rBit1: gSpectateType <MAX_PLAYERS>;
new rBit1: OnDuty <MAX_PLAYERS>;
new rBit1: IsPlayerFreezed <MAX_PLAYERS>;
new rBit1: IsPlayerLogged <MAX_PLAYERS>;
new rBit1: InJailZone <MAX_PLAYERS>;
new rBit1: PlayerMuted <MAX_PLAYERS>;
new rBit16: gSpectateID <MAX_PLAYERS>;
enum pInfo
{
pMoney,
pScore,
pKills,
pDeaths,
pAdmin,
pWarns
}
new PlayerInfo[MAX_PLAYERS][pInfo];
public OnFilterScriptInit()
{
mysql_debug(1);
mysql_connect("localhost", "root", "sa:mp", "");
if(mysql_ping() >= 1) print(" MySQL: Connecting successful!\n");
else print(" MySQL: Connecting unsuccessful!\n");
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
BanBox = TextDrawCreate(650.000000, 0.000000, ".");
TextDrawBackgroundColor(BanBox, 255);
TextDrawFont(BanBox, 1);
TextDrawLetterSize(BanBox, 0.500000, 50.000000);
TextDrawColor(BanBox, -1);
TextDrawSetOutline(BanBox, 0);
TextDrawSetProportional(BanBox, 1);
TextDrawSetShadow(BanBox, 1);
TextDrawUseBox(BanBox, 1);
TextDrawBoxColor(BanBox, 255);
TextDrawTextSize(BanBox, -30.000000, 0.000000);
BanName = TextDrawCreate(240.000000, 151.000000, "Name");
TextDrawBackgroundColor(BanName, 255);
TextDrawFont(BanName, 1);
TextDrawLetterSize(BanName, 0.500000, 1.000000);
TextDrawColor(BanName, -16776961);
TextDrawSetOutline(BanName, 0);
TextDrawSetProportional(BanName, 1);
TextDrawSetShadow(BanName, 1);
BanAdministrator = TextDrawCreate(240.000000, 161.000000, "Administrator");
TextDrawBackgroundColor(BanAdministrator, 255);
TextDrawFont(BanAdministrator, 1);
TextDrawLetterSize(BanAdministrator, 0.500000, 1.000000);
TextDrawColor(BanAdministrator, -16776961);
TextDrawSetOutline(BanAdministrator, 0);
TextDrawSetProportional(BanAdministrator, 1);
TextDrawSetShadow(BanAdministrator, 1);
BanReason = TextDrawCreate(240.000000, 171.000000, "Reason");
TextDrawBackgroundColor(BanReason, 255);
TextDrawFont(BanReason, 1);
TextDrawLetterSize(BanReason, 0.500000, 1.000000);
TextDrawColor(BanReason, -16776961);
TextDrawSetOutline(BanReason, 0);
TextDrawSetProportional(BanReason, 1);
TextDrawSetShadow(BanReason, 1);
return 1;
}
public OnFilterScriptExit()
{
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)
{
CustomBanCheck(playerid);
ResetPlayerMoney(playerid);
TogglePlayerClock(playerid, 0);
ClearChatForPlayer(playerid);
SendClientMessage(playerid, 0x80FF0099, "Type /help to see list of commands!");
format(Query, sizeof(Query), "SELECT User FROM `users` WHERE `User` = '%s' LIMIT 1", mysql_get_name(playerid));
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() == 1)
{
format(title, sizeof(title), "{00CCFF} Welcome{FFFFFF} %s!", GetName(playerid));
format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is registered!\nLogin!", GetName(playerid));
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT , title, text2, "Ok", "Exit");
}
else
{
format(title, sizeof(title), "{00CCFF} Welcome{FFFFFF} %s!", GetName(playerid));
format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is not registered!\nRegister!", GetName(playerid));
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT , title, text2, "Ok", "Exit");
}
mysql_free_result();
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(rBit1_Get(IsPlayerLogged, playerid))
{
format(Query, sizeof(Query), "UPDATE `racuni` SET `Money` = '%d', `Score` = '%d', `Kills` = '%d', `Deathsя= '%d', `Admin` = '%d', `Warns` = '%d' WHERE `Korisnik` = '%s'", GetPlayerMoney(playerid), GetPlayerScore(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pWarns], mysql_get_name(playerid));
mysql_query(Query);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
if(rBit1_Get(PlayerMuted, playerid))
{
SendClientMessage(playerid, COLOR_YELLOW, "* You can't talk, you are muted!");
return 0;
}
if(IsChatOnOrOff == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "* You can't talk, chat is turned off!");
return 0;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1:
{
if(!strlen(inputtext))
{
format(title, sizeof(title), "{00CCFF} Welcome{FFFFFF} %s!", GetName(playerid));
format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is not registered!\nRegister!", GetName(playerid));
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT , title, text2, "Ok", "Exit");
}
new password[100];
mysql_real_escape_string(inputtext, password);
format(Query, sizeof(Query), "INSERT INTO `users` (User, Password, Money, Score, Kills, Deaths, Admin, Warns, IP) VALUES('%s', '%s', 0, 0, 0, 0, 0, 0, '%s')", mysql_get_name(playerid), password, GetIP(playerid));
mysql_query(Query);
rBit1_Set(IsPlayerLogged, playerid, 1);
format(string, sizeof(string), "You have registered with name {FFFFFF}'%s' {FFFF00}and password {FFFFFF}'%s'{FFFF00}!", GetName(playerid), inputtext);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
case 2:
{
if(!response) return Kick(playerid);
new password[128], savingstring[1000];
mysql_real_escape_string(inputtext, password);
format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `User` = '%s' AND `Password` = '%s' LIMIT 1", mysql_get_name(playerid), password);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() == 0)
{
SetPVarInt(playerid, "WrongPass", GetPVarInt(playerid, "WrongPass") + 1);
format(title, sizeof(title), "{00CCFF} Welcome{FFFFFF} %s!", GetName(playerid));
format(text2, sizeof(text2), "{FFFFFF}______________________________\n\n{00CCFF}Name{FFFFFF} %s{00CCFF} is registered!\nLogin!\n\n{F81414}You typed wrong password!", GetName(playerid));
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT , title, text2, "Ok", "Izlaz");
if(GetPVarInt(playerid, "WrongPass") == 3)
{
format(string, sizeof(string), "Server: {F81414}%s is kicked from server! Reason: 3 times typed wrong password!", GetName(playerid));
SendClientMessageToAll(COLOR_WHITE, string);
}
}
else
{
if(mysql_fetch_row_format(Query, "|"))
{
rBit1_Set(IsPlayerLogged, playerid, 1);
mysql_fetch_field_row(savingstring, "Money"); PlayerInfo[playerid][pMoney] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Score"); PlayerInfo[playerid][pScore] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Kills"); PlayerInfo[playerid][pKills] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Deaths"); PlayerInfo[playerid][pDeaths] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Admin"); PlayerInfo[playerid][pAdmin] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Warns"); PlayerInfo[playerid][pWarns] = strval(savingstring);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
}
}
mysql_free_result();
}
case 3:
{
if(!response) return 0;
format(string, sizeof(string), "* Player %s need help: %s", GetName(playerid), inputtext);
SendClientMessageToAdmins(COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_LIME, "* Your question has been sent to administrators!");
}
case 4:
{
if(!response) return 0;
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Name", "Enter the ID of a player to whom you want to teleport!", "Ok", "Izlaz");
}
case 1:
{
if(Pos[0] == 0.0 && Pos[1] == 0.0 && Pos[2] == 0.0) return SendClientMessage(playerid, COLOR_WHITE, "* Type /setloc before teleporting!");
else
if(IsPlayerInAnyVehicle(playerid))
{
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, Pos[0], Pos[1], Pos[2]);
SetPlayerFacingAngle(playerid, Pos[3]);
}
else
{
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerFacingAngle(playerid, Pos[3]);
}
SendClientMessage(playerid, COLOR_YELLOW, "* You have been teleported to your last location!");
}
case 2:
{
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid, 264.2483,77.5985,1001.0391);
SendClientMessage(playerid, COLOR_YELLOW, "* You have been teleported to the jail!");
}
}
}
case 5:
{
if(!response) return 0;
if(strval(inputtext) == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else if(strval(inputtext) == playerid) return SendClientMessage(playerid, COLOR_WHITE, "You can't teleport to your self!");
GetPlayerPos(strval(inputtext), Pos[0], Pos[1], Pos[2]);
SetPlayerPosWithVehicle(playerid, Pos[0] + 2, Pos[1] + 2, Pos[2]);
format(string, sizeof(string), "* You have teleported to player %s!", GetName(strval(inputtext)));
SendClientMessage(playerid, COLOR_YELLOW, string);
}
case 9:
{
if(!response) return 0;
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
}
case 1:
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
}
}
}
case 10:
{
if(!response) return 0;
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
}
case 1:
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
}
case 2:
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of score that you want to set!", "Ok", "Exit");
}
case 3:
{
ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of money that you want to give!", "Ok", "Exit");
}
}
}
case 11:
{
if(!response) return 0;
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
}
case 1:
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
}
case 2:
{
ShowPlayerDialog(playerid, 19, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of money that you want to set!", "Ok", "Exit");
}
case 3:
{
ShowPlayerDialog(playerid, 14, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of score that you want to set!", "Ok", "Exit");
}
case 4:
{
ShowPlayerDialog(playerid, 16, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of kills that you want to set!", "Ok", "Exit");
}
case 5:
{
ShowPlayerDialog(playerid, 17, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of deaths that you want to set!", "Ok", "Exit");
}
case 6:
{
ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, " Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
}
case 7:
{
ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of money that you want to give!", "Ok", "Exit");
}
}
}
case 12:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
if(strlen(inputtext) < 0 || strlen(inputtext) > 100)
{
ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of health that you want to set!", "Ok", "Exit");
SendClientMessage(playerid, COLOR_WHITE, "Health must be beetwen 0 & 100");
}
SetPlayerHealth(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
format(string, sizeof(string), "* You set player %s health on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string), "* Administrator %s has set your health!", GetName(playerid));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
case 13:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
if(strlen(inputtext) < 0 || strlen(inputtext) > 100)
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of armour that you want to set!", "Ok", "Exit");
SendClientMessage(playerid, COLOR_WHITE, "Armour must be beetwen 0 & 100");
}
SetPlayerArmour(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
format(string, sizeof(string), "* You set player %s armour on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string), "* Administrator %s has set your armour!", GetName(playerid));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
case 14:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 14, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of score that you want to set!", "Ok", "Exit");
PlayerInfo[GetPVarInt(playerid, "SelectedID")][pScore] = strval(inputtext);
SetPlayerScore(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
format(Query, sizeof(Query), "UPDATE `users` SET `Score` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
mysql_query(Query);
format(string, sizeof(string), "* You set player %s score on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has set your score on %d!", GetName(playerid), strval(inputtext));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
case 15:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 15, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of money that you want to give!", "Ok", "Exit");
PlayerInfo[GetPVarInt(playerid, "SelectedID")][pMoney] += strval(inputtext);
GivePlayerMoney(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
format(Query, sizeof(Query), "UPDATE `users` SET `Money` = '%d' WHERE `User` = '%s'", PlayerInfo[GetPVarInt(playerid, "SelectedID")][pMoney], mysql_get_name(GetPVarInt(playerid, "SelectedID")));
mysql_query(Query);
format(string, sizeof(string), "* You give player %s $%d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has give you $%d!", GetName(playerid), strval(inputtext));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
case 16:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 16, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of kills that you want to set!", "Ok", "Exit");
PlayerInfo[GetPVarInt(playerid, "SelectedID")][pKills] = strval(inputtext);
format(Query, sizeof(Query), "UPDATE `users` SET `Kills` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
mysql_query(Query);
format(string, sizeof(string), "* You set player %s kills on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has set your kills on %d!", GetName(playerid), strval(inputtext));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
case 17:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 17, DIALOG_STYLE_INPUT, " Ammount", "Type an ammount of deaths that you want to set!", "Ok", "Exit");
PlayerInfo[GetPVarInt(playerid, "SelectedID")][pDeaths] = strval(inputtext);
format(Query, sizeof(Query), "UPDATE `users` SET `Deaths` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
mysql_query(Query);
format(string, sizeof(string), "* You set player %s deaths on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has set your deaths on %d!", GetName(playerid), strval(inputtext));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
case 18:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, " Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
if(strlen(inputtext) < 0 || strlen(inputtext) > 3)
{
ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, " Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
SendClientMessage(playerid, COLOR_WHITE, "Level must be beetwen 0 & 3");
}
PlayerInfo[GetPVarInt(playerid, "SelectedID")][pAdmin] = strval(inputtext);
format(Query, sizeof(Query), "UPDATE `users` SET `Admin` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
mysql_query(Query);
format(string, sizeof(string), "* You set palyer %s administrator level on %d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has set your administrator level on %d!", GetName(playerid), strval(inputtext));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
case 19:
{
if(!response) return 0;
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 18, DIALOG_STYLE_INPUT, " Ammount", "Type an admin level that you want to set!", "Ok", "Exit");
PlayerInfo[GetPVarInt(playerid, "SelectedID")][pMoney] = strval(inputtext);
ResetPlayerMoney(GetPVarInt(playerid, "SelectedID"));
GivePlayerMoney(GetPVarInt(playerid, "SelectedID"), strval(inputtext));
format(Query, sizeof(Query), "UPDATE `users` SET `Money` = '%d' WHERE `User` = '%s'", strval(inputtext), mysql_get_name(GetPVarInt(playerid, "SelectedID")));
mysql_query(Query);
format(string, sizeof(string), "* You set player %s money on $%d!", GetName(GetPVarInt(playerid, "SelectedID")), strval(inputtext));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has set your money on %$d!", GetName(playerid), strval(inputtext));
SendClientMessage(GetPVarInt(playerid, "SelectedID"), COLOR_LIME, string2);
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
/*=================================================Commands=================================================*/
YCMD:help(playerid, params[], help)
{
#pragma unused help
#pragma unused params
ShowPlayerDialog(playerid, 7, DIALOG_STYLE_MSGBOX, "Help!","{F81414}Commands\n\n\n{00C0FF}/stats /vcolor /v /report /new /report /pay /kill /refresh /admins", "Ok", "");
return 1;
}
YCMD:stats(playerid, params[], help)
{
#pragma unused help
#pragma unused params
new largestring[400];
format(largestring, sizeof(largestring), "Money: %d\nScore: %d\nKills: %d\nDeaths: %d\nWarns: %d", GetPlayerMoney(playerid), GetPlayerScore(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pWarns]);
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX, " Your stats", largestring, "Ok", "");
return 1;
}
YCMD:vcolor(playerid, params[], help)
{
#pragma unused help
new color, color2, vehicleid = GetPlayerVehicleID(playerid);
if(rBit1_Get(InJailZone, playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "* You can't use commands in Color!");
if(sscanf(params, "ii", color, color2)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /vcolor [Color 1] [Boja 2]");
else if(color < 0 || color > 252 || color2 < 0 || color2 > 252) return SendClientMessage(playerid, COLOR_WHITE, "* Color must be beetwen 0 & 252!");
else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "* You must be in a vehicle!");
else ChangeVehicleColor(vehicleid, color, color2);
return 1;
}
YCMD:v(playerid, params[], help)
{
#pragma unused help
new vname[128];
if(sscanf(params, "s[128]", vname)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /v [Vehicle Name]");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "* You are already in a vehicle!");
CreateVehicleForPlayer(playerid, vname, -1, -1);
return 1;
}
YCMD:report(playerid, params[], help)
{
#pragma unused help
new id, reason[128];
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /report [ID][Reason]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
format(string, sizeof(string), "* Player %s is reporting player %s: %s", GetName(playerid), GetName(id), reason);
SendClientMessageToAdmins(COLOR_YELLOW, string);
SendClientMessage(playerid, COLOR_LIME, "* Your report has been sent to administrators!");
return 1;
}
YCMD:new(playerid, params[], help)
{
#pragma unused help
#pragma unused params
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Help!", "Type question for administrators!", "Ok", "Exit");
return 1;
}
YCMD:pay(playerid, params[], help)
{
#pragma unused help
new id, ammount;
if(rBit1_Get(InJailZone, playerid)) return SendClientMessage(playerid, COLOR_ORANGE, "* You can't use commands in jail!");
if(sscanf(params, "ui", id, ammount)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /pay [ID][Ammount]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
if(ammount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You don't have too much money!");
if(ammount < 1) return SendClientMessage(playerid, COLOR_GREEN, "* Ammount must be higher than 0!");
else
GivePlayerMoney(id, ammount);
GivePlayerMoney(playerid, -ammount);
format(string, sizeof(string), "* You give player %s $%d!", GetName(id), ammount);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Player %s has gave you $%d!", GetName(playerid), ammount);
SendClientMessage(id, COLOR_LIME, string2);
return 1;
}
YCMD:kill(playerid, params[], help)
{
#pragma unused help
#pragma unused params
SetPlayerHealth(playerid, 0.0);
return 1;
}
YCMD:refresh(playerid, params[], help)
{
#pragma unused help
#pragma unused params
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_LIME, "* You are refreshed, if you still have problems contact an administrators!");
return 1;
}
YCMD:admins(playerid, params[], help)
{
#pragma unused help
#pragma unused params
SendClientMessage(playerid, COLOR_KRED, "<~~ Administratori Online ~~>");
foreach(Player, i)
if(PlayerInfo[i][pAdmin] == 1)
{
format(string, sizeof(string), "%s (Gamemaster)", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(PlayerInfo[i][pAdmin] == 2)
{
format(string, sizeof(string), "%s (Administrator)", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(PlayerInfo[i][pAdmin] == 3)
{
format(string, sizeof(string), "%s (Head)", GetName(i));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
return 1;
}
/*================================================Admin Commands================================================*/
YCMD:slap(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /slap [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(id, Pos[0], Pos[1], Pos[2] + 8);
format(string,sizeof(string), "* You slaped %s!", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has slaped you!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:explode(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /explode [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 1);
CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 1);
CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 1);
format(string, sizeof(string), "* You exploded player %s!", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* You explode by administrator %s!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:mute(playerid, params[], help)
{
#pragma unused help
new id, time, reason[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "uds[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /mute [ID][Time][Reason]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
if(rBit1_Get(PlayerMuted, id)) return SendClientMessage(playerid, COLOR_YELLOW, "* Player is already muted!");
rBit1_Set(PlayerMuted, id, 1);
MuteTimer[id] = SetTimerEx("UnMute", time*1000*60, 0, "d", id);
format(string, sizeof(string), "* You muted player %s on %d minutes!", GetName(id), time);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* You are muted by administrator %s on %d minutes! Reason: %s", GetName(playerid), time, reason);
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:unmute(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unmute [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
if(!rBit1_Get(PlayerMuted, id)) return SendClientMessage(playerid, COLOR_KRED, "* Player isn't muted!");
rBit1_Set(PlayerMuted, id, 0);
KillTimer(MuteTimer[id]);
format(string, sizeof(string), "* You unmuted player %s!", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* You are unmuted by administrator %s!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:freeze(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /freeze [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
if(rBit1_Get(IsPlayerFreezed, id)) return SendClientMessage(playerid, COLOR_WHITE, "Player is already freezed!");
TogglePlayerControllable(id, 0);
rBit1_Set(IsPlayerFreezed, id, 1);
format(string, sizeof(string), "* You freezed player %s", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has freezed you!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:unfreeze(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unfreeze [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
if(!rBit1_Get(IsPlayerFreezed, id)) return SendClientMessage(playerid, COLOR_WHITE, "Player isn't freezed!");
TogglePlayerControllable(id, 1);
rBit1_Set(IsPlayerFreezed, id, 0);
format(string, sizeof(string), "* You unfreezed palyer %s", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has unfreezed you!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:crash(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /crash [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
CreatePlayerObject(id, 385, Pos[0], Pos[1], Pos[2], 0, 0, 0);
format(string, sizeof(string), "* You crashed player %s", GetName(id));
SendClientMessage(playerid, COLOR_RED, string);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:jail(playerid, params[], help)
{
#pragma unused help
new id, time, reason[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "uds[128]", id, time, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /jail [ID][Time][Reason]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
if(rBit1_Get(InJailZone, id)) return SendClientMessage(playerid, COLOR_YELLOW, "Player is already in jail!");
rBit1_Set(InJailZone, id, 1);
SetPlayerInterior(id, 6);
SetPlayerPos(id, 264.2483,77.5985,1001.03914);
JailTimer[id] = SetTimerEx("UnJail", time*1000*60, 0, "d", id);
format(string, sizeof(string), "* You put player %s in the jail on %d minutes!", GetName(id), time);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has put you in the jail on %d minutes! Reason: %s", GetName(playerid), time, reason);
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:unjail(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unjail [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
if(!rBit1_Get(InJailZone, id)) return SendClientMessage(playerid, COLOR_YELLOW, "Igraи nije u zatvoru!");
rBit1_Set(InJailZone, id, 0);
SetPlayerInterior(id, 0);
SpawnPlayer(id);
KillTimer(JailTimer[id]);
format(string, sizeof(string), "* You unjailed player %s iz zatvora!", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has unjailed you!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:kick(playerid, params[], help)
{
#pragma unused help
new id, reason[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /kick [ID][Reason]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
TogglePlayerControllable(id, 0);
format(string, sizeof(string), "** Server: {F81414}%s is kicked from server by administator %s! Reason: %s!", GetName(id), GetName(playerid), reason);
SendClientMessageToAll(COLOR_WHITE, string);
Kick(id);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:warn(playerid, params[], help)
{
#pragma unused help
new id, percentage, reason[128], string3[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "us[128]i", id, reason, percentage)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /warn [ID][Reason][Percentage]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else if(percentage > 100 || percentage < 1) return SendClientMessage(playerid, COLOR_WHITE, "Percentage must be beetwen 1 & 100!");
else
PlayerInfo[id][pWarns] = PlayerInfo[id][pWarns] + percentage;
format(Query, sizeof(Query), "UPDATE `users` SET `Warns` = '%d' WHERE `User` = '%s'", PlayerInfo[id][pWarns], mysql_get_name(id));
mysql_query(Query);
format(string, sizeof(string), "* You give player %s %d percentage of warnings!", GetName(id), percentage);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has give %d percentage of warnings! Reason: %s", GetName(playerid), percentage, reason);
SendClientMessage(id, COLOR_LIME, string2);
if(PlayerInfo[id][pWarns] >= 100)
{
TogglePlayerControllable(id, 0);
format(string3, sizeof(string3), "** Server: {F81414}%s is banned from serve by administator %s! Reason: 100 percentage of warnings!", GetName(id), GetName(playerid));
SendClientMessageToAll(COLOR_WHITE, string3);
CustomBan(id, playerid, reason);
}
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:ban(playerid, params[], help)
{
#pragma unused help
new id, reason[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [ID][Razlog]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
TogglePlayerControllable(id, 0);
format(string, sizeof(string), "** Server: {F81414}%s is banned from serve by administator %s! Reason: %s!", GetName(id), GetName(playerid), reason);
SendClientMessageToAll(COLOR_WHITE, string);
ClearChatForPlayer(id);
format(string, sizeof(string), "Name: ~w~%s", GetName(id));
TextDrawSetString(BanName, string);
format(string, sizeof(string), "Administrator: ~w~%s", GetName(playerid));
TextDrawSetString(BanAdministrator, string);
format(string, sizeof(string), "Reason: ~w~%s", reason);
TextDrawSetString(BanReason, string);
TextDrawShowForPlayer(id, BanBox);
TextDrawShowForPlayer(id, BanName);
TextDrawShowForPlayer(id, BanAdministrator);
TextDrawShowForPlayer(id, BanReason);
CustomBan(id, playerid, reason);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:unban(playerid, params[], help)
{
#pragma unused help
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
{
if(isnull(params) || strlen(params) > MAX_PLAYER_NAME) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /unban [Ime]");
format(Query, sizeof(Query), "SELECT Banned FROM `bans` WHERE `Banned` = '%s' LIMIT 1", params);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() == 0) return SendClientMessage(playerid, COLOR_WHITE, "Invalid name!");
CustomUnban(params);
format(string, sizeof(string), "* You unbanned player %s", params);
SendClientMessage(playerid, COLOR_YELLOW, string);
mysql_free_result();
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:goto(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Goto", "Player\nLast saved position\nJail", "Ok", "Exit");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:gethere(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /gethere [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else if(id == playerid) return SendClientMessage(playerid, COLOR_WHITE, "* You can't teleport you to you!");
else
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(id, Pos[0] + 2, Pos[1] + 2, Pos[2]);
SetPlayerInterior(id, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "* You teleported %s to you!", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has teleported you to him!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:setloc(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
SendClientMessage(playerid, COLOR_YELLOW, "* You possition is saved!");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:givegun(playerid, params[], help)
{
#pragma unused help
new id, weaponid, ammo;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "uii", id, weaponid, ammo)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /givegun [ID][Gun ID][Ammo]");
else if(weaponid > 46 || weaponid < 1) return SendClientMessage(playerid, COLOR_WHITE, "* Gun ID must be beetwen 1 & 46!");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
GivePlayerWeapon(id, weaponid, ammo);
format(string, sizeof(string), "* You give player %s weapon %s!", GetName(id), GetWeapon(weaponid));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2 ,sizeof(string2), "* Administrator %s has give you weapon %s!", GetName(playerid), GetWeapon(weaponid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:weaponid(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
SendClientMessage(playerid,COLOR_WHITE,"----------------------------------WEAPON ID'S----------------------------------------");
SendClientMessage(playerid,COLOR_ORANGE,"ID 1 || Brass Knuckles ");
SendClientMessage(playerid,COLOR_ORANGE,"ID 2 || Golf Club");
SendClientMessage(playerid,COLOR_ORANGE,"ID 3 || Nite Stick");
SendClientMessage(playerid,COLOR_ORANGE,"ID 4 || Knife");
SendClientMessage(playerid,COLOR_ORANGE,"ID 5 || Baseball Bat");
SendClientMessage(playerid,COLOR_ORANGE,"ID 6 || Shovel");
SendClientMessage(playerid,COLOR_ORANGE,"ID 7 || Pool Cue");
SendClientMessage(playerid,COLOR_ORANGE,"ID 8 || Katana");
SendClientMessage(playerid,COLOR_ORANGE,"ID 9 || Chainsaw");
SendClientMessage(playerid,COLOR_ORANGE,"ID 10 || Purple Dildo");
SendClientMessage(playerid,COLOR_ORANGE,"ID 11 || Small White Vibrator");
SendClientMessage(playerid,COLOR_ORANGE,"ID 12 || Large White Vibrator");
SendClientMessage(playerid,COLOR_ORANGE,"ID 13 || Silver Vibrator");
SendClientMessage(playerid,COLOR_ORANGE,"ID 14 || Flowers");
SendClientMessage(playerid,COLOR_ORANGE,"ID 15 || Cane");
SendClientMessage(playerid,COLOR_ORANGE,"ID 16 || Grenade");
SendClientMessage(playerid,COLOR_ORANGE,"ID 17 || Tear Gas");
SendClientMessage(playerid,COLOR_ORANGE,"ID 18 || Molotov Cocktail");
SendClientMessage(playerid,COLOR_ORANGE,"ID 22 || 9mm");
SendClientMessage(playerid,COLOR_ORANGE,"ID 23 || Silenced 9mm");
SendClientMessage(playerid,COLOR_ORANGE,"ID 24 || Desert Eagle");
SendClientMessage(playerid,COLOR_ORANGE,"ID 25 || Shotgun");
SendClientMessage(playerid,COLOR_ORANGE,"ID 26 || Sawn-off Shotgun");
SendClientMessage(playerid,COLOR_ORANGE,"ID 27 || Combat Shotgun");
SendClientMessage(playerid,COLOR_ORANGE,"ID 28 || Micro SMG");
SendClientMessage(playerid,COLOR_ORANGE,"ID 29 || MP5");
SendClientMessage(playerid,COLOR_ORANGE,"ID 30 || AK-47");
SendClientMessage(playerid,COLOR_ORANGE,"ID 31 || M4");
SendClientMessage(playerid,COLOR_ORANGE,"ID 32 || Tec9");
SendClientMessage(playerid,COLOR_ORANGE,"ID 33 || Country Rifle");
SendClientMessage(playerid,COLOR_ORANGE,"ID 34 || Sniper Rifle");
SendClientMessage(playerid,COLOR_ORANGE,"ID 35 || Rocket Launcher");
SendClientMessage(playerid,COLOR_ORANGE,"ID 36 || HS Rocket Launcher");
SendClientMessage(playerid,COLOR_ORANGE,"ID 37 || Flamethrower");
SendClientMessage(playerid,COLOR_ORANGE,"ID 38 || Minigun");
SendClientMessage(playerid,COLOR_ORANGE,"ID 39 || Satchel Charge");
SendClientMessage(playerid,COLOR_ORANGE,"ID 40 || Detonator");
SendClientMessage(playerid,COLOR_ORANGE,"ID 41 || Spraycan");
SendClientMessage(playerid,COLOR_ORANGE,"ID 42 || Fire Extinguisher");
SendClientMessage(playerid,COLOR_ORANGE,"ID 43 || Camera");
SendClientMessage(playerid,COLOR_ORANGE,"ID 44 || Nightvision Goggles");
SendClientMessage(playerid,COLOR_ORANGE,"ID 45 || Thermal Goggles");
SendClientMessage(playerid,COLOR_ORANGE,"ID 46 || Parachute");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:o(playerid, params[], help)
{
#pragma unused help
new text[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "s[128]", text)) SendClientMessage(playerid, COLOR_WHITE, "Usage: /o [Text]");
if(PlayerInfo[playerid][pAdmin] == 1) return format(string, sizeof(string), "{FF00EA}Gamemaster %s: %s", GetName(playerid), text);
else if(PlayerInfo[playerid][pAdmin] == 2) return format(string, sizeof(string), "{FF00EA}Administrator %s: %s", GetName(playerid), text);
else if(PlayerInfo[playerid][pAdmin] == 3) return format(string, sizeof(string), "{FF00EA}Head %s: %s", GetName(playerid), text);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:a(playerid, params[], help)
{
#pragma unused help
new text[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /a [Text]");
if(PlayerInfo[playerid][pAdmin] == 1) return format(string, sizeof(string), "{FF00EA}Gamemaster %s: %s", GetName(playerid), text);
else if(PlayerInfo[playerid][pAdmin] == 2) return format(string, sizeof(string), "{FF00EA}Administrator %s: %s", GetName(playerid), text);
else if(PlayerInfo[playerid][pAdmin] == 3) return format(string, sizeof(string), "{FF00EA}Head %s: %s", GetName(playerid), text);
SendClientMessageToAdmins(COLOR_WHITE, string);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:chat(playerid, params[], help)
{
#pragma unused help
new chatOnOff;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
{
if(sscanf(params, "i", chatOnOff)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /chat [0-1]");
switch(chatOnOff)
{
case 0:
{
IsChatOnOrOff = 0;
format(string, sizeof(string), "* Administrator %s has turned off chat!", GetName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
}
case 1:
{
IsChatOnOrOff = 1;
format(string, sizeof(string), "* Administrator %s has turned on chat!", GetName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE,string);
}
}
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:cc(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
ClearChat();
format(string, sizeof(string), "* Administrator %s has clean the chat!", GetName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:cnn(playerid, params[], help)
{
#pragma unused help
new type, text[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "is[128]", type, text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cnn [Type][Text]");
GameTextForAll(text, 3800, type);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:scream(playerid, params[], help)
{
#pragma unused help
new text[128];
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
{
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /scream [Text]");
format(string, sizeof(string), "* %s: %s", GetName(playerid), text);
SendClientMessageToAll(COLOR_KRED, string);
SendClientMessageToAll(COLOR_YELLOW, string);
SendClientMessageToAll(COLOR_GREEN, string);
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
SendClientMessageToAll(COLOR_GREY, string);
SendClientMessageToAll(COLOR_BLUE, string);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:uping(playerid, params[], help)
{
#pragma unused help
new newz;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "i", newz)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /uping [High]");
else if(newz > 20000 || newz < 1) return SendClientMessage(playerid, COLOR_WHITE, "* High must be beetwen 1 & 20000");
else
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2] + newz);
SendClientMessage(playerid, COLOR_YELLOW, "* You moved up!");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:downing(playerid, params[], help)
{
#pragma unused help
new newz;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "i", newz)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /downing [High]");
else if(newz > 20000 || newz < 1) return SendClientMessage(playerid, COLOR_WHITE, "* High must be beetwen 1 & 20000");
else
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2] - newz);
SendClientMessage(playerid, COLOR_YELLOW, "* You moved down!");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:godmodeon(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
SetPlayerHealth(playerid, 99999.0);
SetPlayerArmour(playerid, 99999.0);
SendClientMessage(playerid, COLOR_YELLOW, "* You use godmode!");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:godmodeoff(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, "* You don't use godmode!");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:specon(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /specon [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, id);
SetPlayerInterior(playerid, GetPlayerInterior(id));
rBit1_Set(gSpectateID, id, 1);
rBit1_Set(gSpectateType, playerid, 1);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:specoff(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
TogglePlayerSpectating(playerid, 0);
rBit16_Set(gSpectateID, playerid, 1);
rBit1_Set(gSpectateType, playerid, 0);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:vehid(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not in a vehicle!");
format(string, sizeof(string), "* ID of this vehicle is: %d", GetPlayerVehicleID(playerid) - 400);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:remove(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /remove [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
if(IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not in a vehicle!");
RemovePlayerFromVehicle(id);
format(string, sizeof(string), "* You removed player %s from vehicle!", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has removed you from vehicle!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:destroyveh(playerid, params[], help)
{
#pragma unused help
new vID;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(sscanf(params, "i", vID))
{
SendClientMessage(playerid, COLOR_WHITE, "Usage: /destroyveh [ID]");
SendClientMessage(playerid, COLOR_WHITE, "Type /vehid to see ID of this vehicle!");
return 1;
}
RemovePlayerFromVehicle(playerid);
DestroyVehicle(vID);
format(string, sizeof(string), "* You deleted vehicle: %d", vID - 400);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:disarm(playerid, params[], help)
{
#pragma unused help
new id;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /disarm [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
else
ResetPlayerWeapons(id);
format(string, sizeof(string), "* You disarmed player %s!", GetName(id));
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string2, sizeof(string2), "* Administrator %s has disarmed you!", GetName(playerid));
SendClientMessage(id, COLOR_LIME, string2);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:onduty(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(rBit1_Get(OnDuty, playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are already on a duty!");
Duty[playerid] = Create3DTextLabel("Na duћnosti!", COLOR_LIME, 0, 0, 0, 50, -1, 1);
Attach3DTextLabelToPlayer(Duty[playerid], playerid, 0, 0, 0);
SetPlayerColor(playerid, COLOR_LIME);
SetPlayerColor(playerid, COLOR_GREEN);
SetPlayerHealth(playerid, 250);
SetPlayerArmour(playerid, 250);
format(string, sizeof(string), "* %s is now on duty!", GetName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
rBit1_Set(OnDuty, playerid, 1);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:offduty(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 1)
{
if(!rBit1_Get(OnDuty, playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not on a duty!");
Delete3DTextLabel(Duty[playerid]);
SetPlayerColor(playerid, COLOR_WHITE);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
format(string, sizeof(string), "* %s isn't on duty!", GetName(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
rBit1_Set(OnDuty, playerid, 0);
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:editinfo(playerid, params[], help)
{
#pragma unused help
new id;
if(PlayerInfo[playerid][pAdmin] == 1)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /editinfo [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
SetPVarInt(playerid, "SelectedID", id);
format(title, sizeof(title), " %s", GetName(id));
ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, title, "Set health\nSet armour", "Ok", "Exit");
}
else if(PlayerInfo[playerid][pAdmin] == 2)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /editinfo [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
SetPVarInt(playerid, "SelectedID", id);
format(title, sizeof(title), " %s", GetName(id));
ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, title, "Set health\nSet armour\nSet score\nGive money", "Ok", "Exit");
}
else if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] == 3)
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /editinfo [ID]");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
SetPVarInt(playerid, "SelectedID", id);
format(title, sizeof(title), " %s", GetName(id));
ShowPlayerDialog(playerid, 11, DIALOG_STYLE_LIST, title, "Set health\nSet armour\nSet money\nSet score\nSet kills\nSet deaths\nMake admin\nGive money", "Ok", "Exit");
}
return 1;
}
YCMD:respawn(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
{
RespawnVehicle();
SendClientMessage(playerid, COLOR_YELLOW, "* Vehicles are respawned!");
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
YCMD:gmx(playerid, params[], help)
{
#pragma unused help
#pragma unused params
new reason;
if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 3)
{
SendClientMessageToAll(COLOR_KRED, "* Server will restart in 5 seconds!");
SetTimer("GMXTimer", 5000, 0);
foreach(Player, i)
{
OnPlayerDisconnect(i, reason);
}
}
else SendClientMessage(playerid, COLOR_KRED, "* You are not authorized to use this command!");
return 1;
}
/*=================================================Stocks=================================================*/
stock GetName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
stock mysql_get_name(playerid)
{
new mysqlname[MAX_PLAYER_NAME];
mysql_real_escape_string(GetName(playerid), mysqlname);
return mysqlname;
}
stock GetIP(playerid)
{
new PIP[16];
GetPlayerIp(playerid, PIP, sizeof(PIP));
return PIP;
}
stock GetWeapon(weaponid)
{
new gunname[32];
GetWeaponName(weaponid, gunname, sizeof(gunname));
return gunname;
}
stock SendClientMessageToAdmins(color, const string1[])
{
foreach(Player, i)
if(IsPlayerAdmin(i) || PlayerInfo[i][pAdmin] >= 1) SendClientMessage(i, color, string1);
return 1;
}
stock RespawnVehicle()
{
new bool: used[MAX_VEHICLES] = { false, ... };
foreach(Player, i)
{
if(IsPlayerInAnyVehicle(i))
{
used[GetPlayerVehicleID(i)] = true;
}
}
for(new v; v < MAX_VEHICLES; v++)
{
if(!used[v]) SetVehicleToRespawn(v);
}
}
stock CreateVehicleForPlayer(playerid, vehiclename[], color1, color2)
{
new VMID, CVID;
if(strfind("Landstalker", vehiclename,true,0) != -1) VMID = 400;
if(strfind("Bravura", vehiclename,true,0) != -1) VMID = 401;
if(strfind("Buffalo", vehiclename,true,0) != -1) VMID = 402;
if(strfind("Linerunner", vehiclename,true,0) != -1) VMID = 403;
if(strfind("Perenniel", vehiclename,true,0) != -1) VMID = 404;
if(strfind("Sentinel", vehiclename,true,0) != -1) VMID = 405;
if(strfind("Dumper", vehiclename,true,0) != -1) VMID = 406;
if(strfind("Firetuck", vehiclename,true,0) != -1) VMID = 407;
if(strfind("Trashmaster", vehiclename,true,0) != -1) VMID = 408;
if(strfind("Stretch", vehiclename,true,0) != -1) VMID = 409;
if(strfind("Manana", vehiclename,true,0) != -1) VMID = 410;
if(strfind("Infernus", vehiclename,true,0) != -1) VMID = 411;
if(strfind("Voodoo", vehiclename,true,0) != -1) VMID = 412;
if(strfind("Pony", vehiclename,true,0) != -1) VMID = 413;
if(strfind("Mule", vehiclename,true,0) != -1) VMID = 414;
if(strfind("Cheetah", vehiclename,true,0) != -1) VMID = 415;
if(strfind("Ambulance", vehiclename,true,0) != -1) VMID = 416;
if(strfind("Leviathan", vehiclename,true,0) != -1) VMID = 417;
if(strfind("Moonbeam", vehiclename,true,0) != -1) VMID = 418;
if(strfind("Esperanto", vehiclename,true,0) != -1) VMID = 419;
if(strfind("Taxi", vehiclename,true,0) != -1) VMID = 420;
if(strfind("Washington", vehiclename,true,0) != -1) VMID = 421;
if(strfind("Bobcat", vehiclename,true,0) != -1) VMID = 422;
if(strfind("Mr Whoopie", vehiclename,true,0) != -1) VMID = 423;
if(strfind("BF Injection", vehiclename,true,0) != -1) VMID = 424;
if(strfind("Hunter", vehiclename,true,0) != -1) VMID = 425;
if(strfind("Premier", vehiclename,true,0) != -1) VMID = 426;
if(strfind("Enforcer", vehiclename,true,0) != -1) VMID = 427;
if(strfind("Securicar", vehiclename,true,0) != -1) VMID = 428;
if(strfind("Banshee", vehiclename,true,0) != -1) VMID = 429;
if(strfind("Predator", vehiclename,true,0) != -1) VMID = 430;
if(strfind("Bus", vehiclename,true,0) != -1) VMID = 431;
if(strfind("Rhino", vehiclename,true,0) != -1) VMID = 432;
if(strfind("Barracks", vehiclename,true,0) != -1) VMID = 433;
if(strfind("Hotknife", vehiclename,true,0) != -1) VMID = 434;
if(strfind("ArticleTrailer", vehiclename,true,0) != -1) VMID = 435;
if(strfind("Previon", vehiclename,true,0) != -1) VMID = 436;
if(strfind("Coach", vehiclename,true,0) != -1) VMID = 437;
if(strfind("Cabbie", vehiclename,true,0) != -1) VMID = 438;
if(strfind("Stallion", vehiclename,true,0) != -1) VMID = 439;
if(strfind("Rumpo", vehiclename,true,0) != -1) VMID = 440;
if(strfind("RCBandit", vehiclename,true,0) != -1) VMID = 441;
if(strfind("Romero", vehiclename,true,0) != -1) VMID = 442;
if(strfind("Packer", vehiclename,true,0) != -1) VMID = 443;
if(strfind("Monster", vehiclename,true,0) != -1) VMID = 444;
if(strfind("Admiral", vehiclename,true,0) != -1) VMID = 445;
if(strfind("Squallo", vehiclename,true,0) != -1) VMID = 446;
if(strfind("Seasparrow", vehiclename,true,0) != -1) VMID = 447;
if(strfind("Pizzaboy", vehiclename,true,0) != -1) VMID = 448;
if(strfind("Tram", vehiclename,true,0) != -1) VMID = 449;
if(strfind("Article Trailer 2", vehiclename,true,0) != -1) VMID = 450;
if(strfind("Turismo", vehiclename,true,0) != -1) VMID = 451;
if(strfind("Speeder", vehiclename,true,0) != -1) VMID = 452;
if(strfind("Reefer", vehiclename,true,0) != -1) VMID = 453;
if(strfind("Tropic", vehiclename,true,0) != -1) VMID = 454;
if(strfind("Flatbed", vehiclename,true,0) != -1) VMID = 455;
if(strfind("Yankee", vehiclename,true,0) != -1) VMID = 456;
if(strfind("Caddy", vehiclename,true,0) != -1) VMID = 457;
if(strfind("Solair", vehiclename,true,0) != -1) VMID = 458;
if(strfind("Berkley's RC Van", vehiclename,true,0) != -1) VMID = 459;
if(strfind("Skimmer", vehiclename,true,0) != -1) VMID = 460;
if(strfind("PCJ600", vehiclename,true,0) != -1) VMID = 461;
if(strfind("Faggio", vehiclename,true,0) != -1) VMID = 462;
if(strfind("Freeway", vehiclename,true,0) != -1) VMID = 463;
if(strfind("RCBaron", vehiclename,true,0) != -1) VMID = 464;
if(strfind("RCRaider", vehiclename,true,0) != -1) VMID = 465;
if(strfind("Glendale", vehiclename,true,0) != -1) VMID = 466;
if(strfind("Oceanic", vehiclename,true,0) != -1) VMID = 467;
if(strfind("Sanchez", vehiclename,true,0) != -1) VMID = 468;
if(strfind("Sparrow", vehiclename,true,0) != -1) VMID = 469;
if(strfind("Patriot", vehiclename,true,0) != -1) VMID = 470;
if(strfind("Quad", vehiclename,true,0) != -1) VMID = 471;
if(strfind("Coastguard", vehiclename,true,0) != -1) VMID = 472;
if(strfind("Dinghy", vehiclename,true,0) != -1) VMID = 473;
if(strfind("Hermes", vehiclename,true,0) != -1) VMID = 474;
if(strfind("Sabre", vehiclename,true,0) != -1) VMID = 475;
if(strfind("Rustler", vehiclename,true,0) != -1) VMID = 476;
if(strfind("ZR350", vehiclename,true,0) != -1) VMID = 477;
if(strfind("Walton", vehiclename,true,0) != -1) VMID = 478;
if(strfind("Regina", vehiclename,true,0) != -1) VMID = 479;
if(strfind("Comet", vehiclename,true,0) != -1) VMID = 480;
if(strfind("BMX", vehiclename,true,0) != -1) VMID = 481;
if(strfind("Burrito", vehiclename,true,0) != -1) VMID = 482;
if(strfind("Camper", vehiclename,true,0) != -1) VMID = 483;
if(strfind("Marquis", vehiclename,true,0) != -1) VMID = 484;
if(strfind("Baggage", vehiclename,true,0) != -1) VMID = 485;
if(strfind("Dozer", vehiclename,true,0) != -1) VMID = 486;
if(strfind("Maverick", vehiclename,true,0) != -1) VMID = 487;
if(strfind("SAN News Maverick", vehiclename,true,0) != -1) VMID = 488;
if(strfind("Rancher", vehiclename,true,0) != -1) VMID = 489;
if(strfind("FBI Rancher", vehiclename,true,0) != -1) VMID = 490;
if(strfind("Virgo", vehiclename,true,0) != -1) VMID = 491;
if(strfind("Greenwood", vehiclename,true,0) != -1) VMID = 492;
if(strfind("Jetmax", vehiclename,true,0) != -1) VMID = 493;
if(strfind("Hotring Racer", vehiclename,true,0) != -1) VMID = 494;
if(strfind("Sandking", vehiclename,true,0) != -1) VMID = 495;
if(strfind("Blista Compact", vehiclename,true,0) != -1) VMID = 496;
if(strfind("Police Maverick", vehiclename,true,0) != -1) VMID = 497;
if(strfind("Boxville", vehiclename,true,0) != -1) VMID = 498;
if(strfind("Benson", vehiclename,true,0) != -1) VMID = 499;
if(strfind("Mesa", vehiclename,true,0) != -1) VMID = 500;
if(strfind("RC Goblin", vehiclename,true,0) != -1) VMID = 501;
if(strfind("Hotring Racer", vehiclename,true,0) != -1) VMID = 502;
if(strfind("Hotring Racer", vehiclename,true,0) != -1) VMID = 503;
if(strfind("Bloodring Banger", vehiclename,true,0) != -1) VMID = 505;
if(strfind("Rancher", vehiclename,true,0) != -1) VMID = 505;
if(strfind("Super GT", vehiclename,true,0) != -1) VMID = 506;
if(strfind("Elegant", vehiclename,true,0) != -1) VMID = 507;
if(strfind("Journey", vehiclename,true,0) != -1) VMID = 508;
if(strfind("Bike", vehiclename,true,0) != -1) VMID = 509;
if(strfind("Mountain Bike", vehiclename,true,0) != -1) VMID = 510;
if(strfind("Beagle", vehiclename,true,0) != -1) VMID = 511;
if(strfind("Cropduster", vehiclename,true,0) != -1) VMID = 512;
if(strfind("Stuntplane", vehiclename,true,0) != -1) VMID = 513;
if(strfind("Tanker", vehiclename,true,0) != -1) VMID = 515;
if(strfind("Roadtrain", vehiclename,true,0) != -1) VMID = 515;
if(strfind("Nebula", vehiclename,true,0) != -1) VMID = 516;
if(strfind("Majestic", vehiclename,true,0) != -1) VMID = 517;
if(strfind("Buccaneer", vehiclename,true,0) != -1) VMID = 518;
if(strfind("Shamal", vehiclename,true,0) != -1) VMID = 519;
if(strfind("Hydra", vehiclename,true,0) != -1) VMID = 520;
if(strfind("FCR-900", vehiclename,true,0) != -1) VMID = 521;
if(strfind("NRG-500", vehiclename,true,0) != -1) VMID = 522;
if(strfind("HPV1000", vehiclename,true,0) != -1) VMID = 523;
if(strfind("Cement Truck", vehiclename,true,0) != -1) VMID = 525;
if(strfind("Towtruck", vehiclename,true,0) != -1) VMID = 525;
if(strfind("Fortune", vehiclename,true,0) != -1) VMID = 526;
if(strfind("Cadrona", vehiclename,true,0) != -1) VMID = 527;
if(strfind("FBI Truck", vehiclename,true,0) != -1) VMID = 528;
if(strfind("Willard", vehiclename,true,0) != -1) VMID = 529;
if(strfind("Forklift", vehiclename,true,0) != -1) VMID = 530;
if(strfind("Tractor", vehiclename,true,0) != -1) VMID = 531;
if(strfind("Combine Harvester", vehiclename,true,0) != -1) VMID = 532;
if(strfind("Feltzer", vehiclename,true,0) != -1) VMID = 533;
if(strfind("Remington", vehiclename,true,0) != -1) VMID = 535;
if(strfind("Slamvan", vehiclename,true,0) != -1) VMID = 535;
if(strfind("Blade", vehiclename,true,0) != -1) VMID = 536;
if(strfind("Freight Train", vehiclename,true,0) != -1) VMID = 537;
if(strfind("Brownstreak Train", vehiclename,true,0) != -1) VMID = 538;
if(strfind("Vortex", vehiclename,true,0) != -1) VMID = 539;
if(strfind("Vincent", vehiclename,true,0) != -1) VMID = 540;
if(strfind("Bullet", vehiclename,true,0) != -1) VMID = 541;
if(strfind("Clover", vehiclename,true,0) != -1) VMID = 542;
if(strfind("Sadler", vehiclename,true,0) != -1) VMID = 543;
if(strfind("Firetruck LA", vehiclename,true,0) != -1) VMID = 544;
if(strfind("Hustler", vehiclename,true,0) != -1) VMID = 545;
if(strfind("Intruder", vehiclename,true,0) != -1) VMID = 546;
if(strfind("Primo", vehiclename,true,0) != -1) VMID = 547;
if(strfind("Cargobob", vehiclename,true,0) != -1) VMID = 548;
if(strfind("Tampa", vehiclename,true,0) != -1) VMID = 549;
if(strfind("Sunrise", vehiclename,true,0) != -1) VMID = 550;
if(strfind("Merit", vehiclename,true,0) != -1) VMID = 551;
if(strfind("Utility Van", vehiclename,true,0) != -1) VMID = 552;
if(strfind("Nevada", vehiclename,true,0) != -1) VMID = 553;
if(strfind("Yosemite", vehiclename,true,0) != -1) VMID = 555;
if(strfind("Windsor", vehiclename,true,0) != -1) VMID = 555;
if(strfind("MonsterA", vehiclename,true,0) != -1) VMID = 556;
if(strfind("MonsterB", vehiclename,true,0) != -1) VMID = 557;
if(strfind("Uranus", vehiclename,true,0) != -1) VMID = 558;
if(strfind("Jester", vehiclename,true,0) != -1) VMID = 559;
if(strfind("Sultan", vehiclename,true,0) != -1) VMID = 560;
if(strfind("Stratum", vehiclename,true,0) != -1) VMID = 561;
if(strfind("Elegy", vehiclename,true,0) != -1) VMID = 562;
if(strfind("Raindance", vehiclename,true,0) != -1) VMID = 563;
if(strfind("RC Tiger", vehiclename,true,0) != -1) VMID = 564;
if(strfind("Flash", vehiclename,true,0) != -1) VMID = 565;
if(strfind("Tahoma", vehiclename,true,0) != -1) VMID = 566;
if(strfind("Savanna", vehiclename,true,0) != -1) VMID = 567;
if(strfind("Bandito", vehiclename,true,0) != -1) VMID = 568;
if(strfind("Freight Flat Trailer", vehiclename,true,0) != -1) VMID = 569;
if(strfind("Streak Trailer", vehiclename,true,0) != -1) VMID = 570;
if(strfind("Kart", vehiclename,true,0) != -1) VMID = 571;
if(strfind("Mower", vehiclename,true,0) != -1) VMID = 572;
if(strfind("Dune", vehiclename,true,0) != -1) VMID = 573;
if(strfind("Sweeper", vehiclename,true,0) != -1) VMID = 574;
if(strfind("Broadway", vehiclename,true,0) != -1) VMID = 575;
if(strfind("Tornado", vehiclename,true,0) != -1) VMID = 576;
if(strfind("AT400", vehiclename,true,0) != -1) VMID = 577;
if(strfind("DFT30", vehiclename,true,0) != -1) VMID = 578;
if(strfind("Huntley", vehiclename,true,0) != -1) VMID = 579;
if(strfind("Stafford", vehiclename,true,0) != -1) VMID = 580;
if(strfind("BF400", vehiclename,true,0) != -1) VMID = 581;
if(strfind("Newsvan", vehiclename,true,0) != -1) VMID = 582;
if(strfind("Tug", vehiclename,true,0) != -1) VMID = 583;
if(strfind("Petrol Trailer", vehiclename,true,0) != -1) VMID = 584;
if(strfind("Emperor", vehiclename,true,0) != -1) VMID = 585;
if(strfind("Wayfarer", vehiclename,true,0) != -1) VMID = 586;
if(strfind("Euros", vehiclename,true,0) != -1) VMID = 587;
if(strfind("Hotdog", vehiclename,true,0) != -1) VMID = 588;
if(strfind("Club", vehiclename,true,0) != -1) VMID = 589;
if(strfind("Freight Box Trailer", vehiclename,true,0) != -1) VMID = 590;
if(strfind("Article Trailer 3", vehiclename,true,0) != -1) VMID = 591;
if(strfind("Andromada", vehiclename,true,0) != -1) VMID = 592;
if(strfind("Dodo", vehiclename,true,0) != -1) VMID = 593;
if(strfind("RCCam", vehiclename,true,0) != -1) VMID = 595;
if(strfind("Launch", vehiclename,true,0) != -1) VMID = 595;
if(strfind("Police Car LSPD", vehiclename,true,0) != -1) VMID = 596;
if(strfind("Police Car SFPP", vehiclename,true,0) != -1) VMID = 597;
if(strfind("Police Car LVPD", vehiclename,true,0) != -1) VMID = 598;
if(strfind("Police Ranger", vehiclename,true,0) != -1) VMID = 599;
if(strfind("S.W.A.T. SWAT", vehiclename,true,0) != -1) VMID = 601;
if(strfind("Alpha", vehiclename,true,0) != -1) VMID = 602;
if(strfind("Phoenix", vehiclename,true,0) != -1) VMID = 603;
if(strfind("Glendale Shit", vehiclename,true,0) != -1) VMID = 604;
if(strfind("Sadler Shit", vehiclename,true,0) != -1) VMID = 605;
if(strfind("Baggage Trailer A", vehiclename,true,0) != -1) VMID = 606;
if(strfind("Baggage Trailer B", vehiclename,true,0) != -1) VMID = 607;
if(strfind("Tug Stairs Trailer", vehiclename,true,0) != -1) VMID = 608;
if(strfind("Boxville", vehiclename,true,0) != -1) VMID = 609;
if(strfind("Farm Trailer", vehiclename,true,0) != -1) VMID = 610;
if(strfind("Utility Trailer", vehiclename,true,0) != -1) VMID = 611;
if(strlen(vehiclename) == 3 && strval(vehiclename) >= 400 && strval(vehiclename) <= 611) VMID = strval(vehiclename);
if(VMID == 0) return SendClientMessage(playerid, COLOR_WHITE, "* Netoиno ime vozila!");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
if(IsPlayerInAnyVehicle(playerid)) GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
CVID = CreateVehicle(VMID, Pos[0], Pos[1], Pos[2] + 0.6, Pos[3], color1, color2, 0);
SetVehicleVirtualWorld(CVID, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(CVID, GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, CVID, 0);
SetPVarInt(playerid, "Vehicle", VMID);
SetPVarInt(playerid, "VehicleCreated", CVID);
return 1;
}
stock SetPlayerPosWithVehicle(playerid, Float: X, Float: Y, Float: Z)
{
SetPlayerPos(playerid, X, Y, Z);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(playerid));
SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
}
}
stock CustomBan(id, playerid, reason[])
{
format(Query, sizeof(Query), "INSERT INTO `bans` (Banned, Administrator, Reason) VALUES ('%s', '%s', '%s')", mysql_get_name(id), mysql_get_name(playerid), reason);
mysql_query(Query);
Kick(id);
return 1;
}
stock CustomUnban(name[])
{
if(strlen(name) > MAX_PLAYER_NAME) return 0;
mysql_real_escape_string(name, name);
format(Query, sizeof(Query), "DELETE FROM `bans` WHERE Banned = '%s'", name);
mysql_query(Query);
return 1;
}
stock CustomBanCheck(playerid)
{
new name[MAX_PLAYER_NAME], administrator[MAX_PLAYER_NAME], reason[128], day[11], month[11], year[11], bstring[256];
format(Query, sizeof(Query), "SELECT * FROM `bans` WHERE `Banned` = '%s' LIMIT 1", mysql_get_name(playerid));
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
while(mysql_fetch_row_format(Query, "|"))
{
mysql_fetch_field_row(name, "Banned");
mysql_fetch_field_row(administrator, "Administrator");
mysql_fetch_field_row(reason, "Reason");
mysql_fetch_field_row(day, "Day");
mysql_fetch_field_row(month, "Month");
mysql_fetch_field_row(year, "Year");
}
format(bstring, sizeof(bstring), "{F81414}Name: {FFFFFF}%s\n{F81414}Administrator: {FFFFFF}%s\n{F81414}Reason: {FFFFFF}%s\n{F81414}Date: {FFFFFF}%02d.%02d.%d.", name, administrator, reason, day, month, year);
ShowPlayerDialog(playerid, 87, DIALOG_STYLE_MSGBOX, " {FFFFFF}Protjerani ste s ovog servera!", bstring, "Ok", "");
ClearChatForPlayer(playerid);
Kick(playerid);
}
mysql_free_result();
return 1;
}
then, when i put a_http include in pawno include
Then 26 errors comes
Код:
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\pawno\include\YSI\y_utils.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\pawno\include\YSI\y_utils.inc(310) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\pawno\include\YSI\y_utils.inc(342) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\pawno\include\YSI\y_utils.inc(360) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\pawno\include\YSI\y_bit.inc(243) : error 025: function heading differs from prototype
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\pawno\include\YSI\y_bit.inc(243) : error 025: function heading differs from prototype
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\pawno\include\YSI\y_bit.inc(244) : error 021: symbol already defined: "Bit_Set"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(29) : error 001: expected token: "-identifier-", but found "("
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(30) : error 001: expected token: "-identifier-", but found "("
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(31) : error 001: expected token: "-identifier-", but found "("
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(32) : error 001: expected token: "-identifier-", but found "("
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(33) : error 001: expected token: "-identifier-", but found "("
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(34) : error 001: expected token: "-identifier-", but found "("
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(35) : error 001: expected token: "-identifier-", but found "("
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(143) : error 017: undefined symbol "rBit1_Get"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(164) : error 017: undefined symbol "rBit1_Get"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(233) : error 017: undefined symbol "rBit1_Set"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(261) : error 017: undefined symbol "rBit1_Set"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(545) : error 017: undefined symbol "rBit1_Get"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(546) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(557) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(567) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(588) : error 017: undefined symbol "rBit1_Get"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(589) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(652) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(672) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(695) : error 017: undefined symbol "sscanf"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(698) : error 017: undefined symbol "rBit1_Get"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(699) : error 017: undefined symbol "rBit1_Set"
C:\Documents and Settings\Mostwanted\My Documents\Downloads\samp03e_svr_win32\gamemodes\Untitled.pwn(716) : error 017: undefined symbol "sscanf"
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
26 Errors.

