Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================//
- // Basic GameMode Script //
- //----------------------------------------------------------------------------//
- // By SaNeLSANY //
- //============================================================================//
- //============================================================================// INCLUDE
- #include <a_samp>
- #include <sscanf2>
- #include <streamer>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <foreach>
- //============================================================================//
- //============================================================================// DEFINE
- // COLORS
- #define COLOR_PINK 0xFFC0CBFF
- #define COLOR_RED 0xFF0000FF
- #define COLOR_GREEN 0x008000FF
- #define COLOR_DARKBLUE 0x00008BFF
- #define COLOR_CADETBLUE 0x5F9EA0FF
- #define COLOR_LIGHTBLUE 0xADD8E6FF
- #define COLOR_YELLOW 0xECD400F6
- #define COLOR_LIGHTGREEN 0x90EE90FF
- #define COLOR_PEACHPUFF 0xFFDAB9FF
- #define LIGHTBLUE2 0xF6BB0AA
- #define COLOR_GREY 0x808080FF
- #define COLOR_ORANGE 0xFFA500FF
- #define COLOR_BISQUE 0xFFE4C4FF
- #define COLOR_BLANCHEDALMOND 0xFFEBCDFF
- #define COLOR_BLACK 0x000000AA
- #define CYELLOW "{9DBD1E}"
- #define CORANGE "{E68C0E}"
- #define CBLUE "{39AACC}"
- #define CLGREEN "{30DB52}"
- #define CDGREEN "{6FA828}"
- #define CWHITE "{FFFFFF}"
- #define CREDISH "{CF0C43}"
- #define CRED "{FF0000}"
- #define CLBLUE "{55C2CF}"
- #define CCADET "{5F9EA0}"
- #define CPINK "{FC08CB}"
- #define CDBLUE "{1500FF}"
- #define CAQUA "{5CFFE9}"
- #define CGREY "{7D8584}"
- #define CMAROON "{912514}"
- #define CCORAL "{FF7F50}"
- #define CRACE "{F2DDC4}"
- #define CRACE2 "{2CC900}"
- #define CGAME1 "{E8DB20}"
- #define CGAME2 "{BA80BA}"
- #define CMINIG1 "{648832}"
- #define CMINIG2 "{4F927F}"
- // DIALOGS
- #define DIALOG_REGISTER 0
- #define DIALOG_LOGIN 1
- // OTHER
- #define SCM SendClientMessage
- #define SCMToAll SendClientMessageToAll
- #define USER_PATH "/Players/%s.ini"
- #define INI_Exists(%0) fexist(%0)
- //============================================================================//
- //============================================================================// NEW
- new Text:TextDrawPoruke;
- new Text:Textdraw0;
- new Text:Textdraw1;
- new RandomPoruke[][] =
- {
- "Blank GameMode: ~w~Last update of the server : 29.1.2014",
- "Blank GameMode: ~w~Use /report to ask to admins/report a player",
- "Blank GameMode: ~w~Use /help to se the commands that you can use"
- };
- //============================================================================//
- //============================================================================// FORWARD
- forward ServerPoruke();
- //============================================================================//
- //============================================================================// ENUM
- enum pInfo
- {
- pPassword[124],
- pKills,
- pDeaths,
- pAdmin,
- pLevel,
- pSkin,
- pMoney,
- pLogged
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //============================================================================//
- main()
- {
- print("\n----------------------------------");
- print(" Blank GameMode Script By SaNeLSANY ");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- UsePlayerPedAnims();
- SetGameModeText("| Blank GameMode |");
- TextDrawPoruke = TextDrawCreate(1.000000, 434.000000,"~y~Welcome to ~w~** Blank GameMode **!");
- TextDrawAlignment(TextDrawPoruke,0);
- TextDrawBackgroundColor(TextDrawPoruke,0x000000FF);
- TextDrawFont(TextDrawPoruke,1);
- TextDrawLetterSize(TextDrawPoruke, 0.279999, 1.299997);
- TextDrawColor(TextDrawPoruke,0xffd500FF);
- TextDrawSetOutline(TextDrawPoruke,0);
- TextDrawSetProportional(TextDrawPoruke,1);
- TextDrawSetShadow(TextDrawPoruke,1);
- SetTimer("ServerPoruke",4000,1);
- Textdraw0 = TextDrawCreate(532.000000, 3.000000, "Blank ~n~ GameMode");
- TextDrawBackgroundColor(Textdraw0, 255);
- TextDrawFont(Textdraw0, 1);
- TextDrawLetterSize(Textdraw0, 0.529999, 1.000000);
- TextDrawColor(Textdraw0, 16777215);
- TextDrawSetOutline(Textdraw0, 0);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawSetShadow(Textdraw0, 1);
- Textdraw1 = TextDrawCreate(646.000000, 28.000000, "_");
- TextDrawBackgroundColor(Textdraw1, 255);
- TextDrawFont(Textdraw1, 1);
- TextDrawLetterSize(Textdraw1, 0.500000, -0.900000);
- TextDrawColor(Textdraw1, -1);
- TextDrawSetOutline(Textdraw1, 0);
- TextDrawSetProportional(Textdraw1, 1);
- TextDrawSetShadow(Textdraw1, 1);
- TextDrawUseBox(Textdraw1, 1);
- TextDrawBoxColor(Textdraw1, 255);
- TextDrawTextSize(Textdraw1, 525.000000, -21.000000);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayerInfo[playerid][pLogged] = 0;
- new text[1024], strText[104];
- format(strText, 35, USER_PATH, PlayerName(playerid));
- if(!INI_Exists(strText))
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""#CCADET"Account Registration", ""CYELLOW"Hello! "CBLUE"You must register to play on this server!", "Register", "Leave");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- }
- else
- {
- format(text, sizeof(text)," {0095FF}________________________________________________\n\n{FFFFFF}Welcome to {0095FF}Basic GameMode {FFFFFF}server!\n\n\n{0095FF}%s\n{FFFFFF}Your Account are finded\n\n\nPlease enter your password to enter to this server:\n\n{0095FF}________________________________________________", PlayerName(playerid));
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login",text, "Logiraj","Odustani");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- SCM(playerid, COLOR_BLACK, "");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PlayerInfo[playerid][pLogged] == 1)
- {
- SavePlayer(playerid);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1154.0653,-1458.0643,15.7969, 0,0,0,0,0,0,0);
- TextDrawShowForPlayer(playerid, TextDrawPoruke);
- TextDrawShowForPlayer(playerid, Textdraw0);
- TextDrawShowForPlayer(playerid, Textdraw1);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- if(PlayerInfo[playerid][pLogged] == 0)
- {
- SCM(playerid,COLOR_RED,"You must be logged in before spawn");
- SetTimerEx("KickPlayer", 300, 0, "d", playerid);
- }
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_REGISTER)
- {
- if(!response)
- {
- SCM(playerid, COLOR_LIGHTBLUE, "Hey you, you must register to play on this server !");
- SetTimerEx("KickPlayer", 300, 0, "d", playerid);
- return 1;
- }
- if(response)
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""#CCADET"Account Registration", ""CYELLOW"You must enter a password below to continue!", "Register", "Leave");
- return 1;
- }
- SCM(playerid, COLOR_GREEN, "All right, you are now registered!");
- new uFile[35];
- format(uFile, 35, USER_PATH, PlayerName(playerid));
- new INI:playerFile = INI_Open(uFile);
- INI_WriteInt(playerFile,"Password",udb_hash(inputtext));
- INI_WriteInt(playerFile, "AdminLVL", PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(playerFile, "Money", PlayerInfo[playerid][pMoney]);
- INI_WriteInt(playerFile, "Level", PlayerInfo[playerid][pLevel]);
- INI_WriteInt(playerFile, "Skin", PlayerInfo[playerid][pSkin]);
- INI_Close(playerFile);
- PlayerInfo[playerid][pLevel] = 3;
- PlayerInfo[playerid][pLogged] = 1;
- PlayerInfo[playerid][pMoney] = 1000;
- GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
- SetPlayerSkin(playerid, 1);
- SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
- SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1154.0653,-1458.0643,15.7969, 0,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- }
- if(dialogid == DIALOG_LOGIN)
- {
- if(!response)
- {
- SCM(playerid, COLOR_LIGHTBLUE, "Hey you, you must LogIn to play on this server !");
- SetTimerEx("KickPlayer", 300, 0, "d", playerid);
- return 1;
- }
- if(response)
- {
- new uFile[35];
- format(uFile, 35, USER_PATH, PlayerName(playerid));
- INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
- {
- new coordsstring[124];
- format(uFile, 35, USER_PATH, PlayerName(playerid));
- INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
- format(coordsstring, sizeof(coordsstring), "*Welcome %s on the server",PlayerName(playerid));
- SCM(playerid, 0x33CCFFAA,coordsstring);
- format(coordsstring,sizeof coordsstring,"~n~~n~~n~~n~~n~~n~~w~WELCOME~n~~r~%s!",PlayerName(playerid));
- GameTextForPlayer(playerid, coordsstring, 6000, 3);
- SetPlayerColor(playerid,0xFFFFFFFF);
- PlayerInfo[playerid][pLogged] = 1;
- SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
- SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1154.0653,-1458.0643,15.7969, 0,0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- else
- {
- ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login","Wrong password", "Logiraj","Odustani");
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- //============================================================================//
- forward LoadUserData(playerid, name[], value[]);
- public LoadUserData(playerid, name[], value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPassword]);
- INI_Int("Level",PlayerInfo[playerid][pLevel]);
- INI_Int("Money",PlayerInfo[playerid][pMoney]);
- INI_Int("AdminLVL",PlayerInfo[playerid][pAdmin]);
- INI_Int("Skin",PlayerInfo[playerid][pSkin]);
- return 1;
- }
- forward KickPlayer(playerid);
- public KickPlayer(playerid)
- {
- Kick(playerid);
- }
- public ServerPoruke()
- {
- TextDrawSetString(TextDrawPoruke, RandomPoruke[random(sizeof(RandomPoruke))]);
- return 1;
- }
- //============================================================================// STOCKS
- stock SavePlayer(playerid)
- {
- new uFile[35];
- format(uFile, 35, USER_PATH, PlayerName(playerid));
- new INI:playerFile = INI_Open(uFile);
- INI_WriteInt(playerFile, "AdminLVL", PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(playerFile, "Money", PlayerInfo[playerid][pMoney]);
- INI_WriteInt(playerFile, "Level", PlayerInfo[playerid][pLevel]);
- INI_WriteInt(playerFile, "Skin", PlayerInfo[playerid][pSkin]);
- INI_Close(playerFile);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- stock PlayerName(playerid)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- return pName;
- }
- stock udb_hash(buf[])
- {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- stock AdminMessage(color, string[])
- {
- foreach (Player, i)
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- SCM(i, color, string);
- }
- }
- }
- //============================================================================//
- //============================================================================//
- //============================================================================// ADMINISTATOR COMMANDS
- CMD:ah(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5} {FFFFFF}You don't have permission to this command!");
- SCM(playerid, COLOR_DARKBLUE," [==================================== [Admin Commands] =========]");
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- SCM(playerid, COLOR_DARKBLUE," [1] {FFFFFF}- | /a | /o | /kick | /gethere | /goto | /kill |"); }
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- SCM(playerid, COLOR_DARKBLUE," [2] {FFFFFF}- | In construction ");
- }
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- SCM(playerid, COLOR_DARKBLUE," [3] {FFFFFF}- | In construction ");
- }
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- SCM(playerid, COLOR_DARKBLUE," [4] {FFFFFF}- | In construction "); }
- if(PlayerInfo[playerid][pAdmin] >= 1337)
- {
- SCM(playerid, COLOR_DARKBLUE," [1337] {FFFFFF}- | In construction ");
- }
- if(PlayerInfo[playerid][pAdmin] >= 1338)
- {
- SCM(playerid, COLOR_DARKBLUE," [1338] {FFFFFF}- | In construction ");
- }
- if(IsPlayerAdmin(playerid))
- {
- SCM(playerid, COLOR_DARKBLUE," [1338(+rcon)] {FFFFFF}- | /makeadmin");
- }
- SCM(playerid, COLOR_DARKBLUE," [================================================================]");
- return 1;
- }
- CMD:makeadmin(playerid, params[])
- {
- new targetid, level;
- new string[128];
- if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,"{B5B5B5}{FFFFFF} Rcon Administators only ! ");
- else if (sscanf(params, "ui", targetid, level)) return SCM(playerid, LIGHTBLUE2,"Usage: {FFFFFF}/makeadmin [ID/Nick] [level 1-1338]");
- else if(targetid == INVALID_PLAYER_ID) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
- else
- {
- format(string, sizeof(string),"*You maked | %s to Admin level %i!", PlayerName(targetid), level);
- SCM(playerid, LIGHTBLUE2, string);
- format(string, sizeof(string),"*Congrulations. You are now %i level Admina | Rcon Admin: %s ", level, PlayerName(playerid));
- SCM(targetid, LIGHTBLUE2, string);
- PlayerInfo[targetid][pAdmin] = level;
- format(string, sizeof(string),"*Rcon Admin %s | maked %s to Admin | Level: %i | ",PlayerName(playerid),PlayerName(targetid),level);
- AdminMessage(LIGHTBLUE2, string);
- SavePlayer(targetid);
- }
- return 1;
- }
- CMD:a(playerid, params[])
- {
- new string[128];
- if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
- if(isnull(params)) return SCM(playerid,LIGHTBLUE2,"Usage: {FFFFFF}/(a)dmin [Admin Chat]");
- format(string,128," |%d|A| %s: {FFFFFF}%s",PlayerInfo[playerid][pAdmin],PlayerName(playerid),params);
- AdminMessage(LIGHTBLUE2, string);
- return 1;
- }
- CMD:kick(playerid,params[])
- {
- new id, reason[128], string[128];
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- if(sscanf(params,"us[128]",id,reason)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /kick [ID/Nick] [reason]");
- if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
- format(string, sizeof(string),"|A|Kick| %s are kicked from %s , reason: %s",PlayerName(id),PlayerName(playerid),reason);
- AdminMessage(COLOR_RED,string);
- format(string, sizeof(string),"|A|Kick| You are kicked from %s , reason: %s",PlayerName(playerid),reason);
- SCM(id,COLOR_RED,string);
- SetTimerEx("KickIgracaID", 300, 0, "d", id);
- }
- else
- {
- SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
- }
- return 1;
- }
- CMD:gethere(playerid,params[])
- {
- new targetid, Float:x, Float:y, Float:z;
- new string[128];
- if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
- else if(sscanf(params, "u", targetid)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /gethere [ID/Nick]");
- else if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
- else
- {
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(targetid, x+1, y+1, z);
- if(IsPlayerInAnyVehicle(targetid))
- SetVehiclePos(GetPlayerVehicleID(targetid), x+2,y+2,z);
- PutPlayerInVehicle(targetid, GetPlayerVehicleID(targetid), 0);
- format(string, sizeof(string), "You are ported {00D5FF}%s to you!", PlayerName(targetid));
- SCM(playerid,COLOR_GREY,string);
- format(string, sizeof(string), "%s are ported you to him !", PlayerName(playerid));
- SCM(targetid,COLOR_GREY,string);
- }
- return 1;
- }
- CMD:goto(playerid, params[])
- {
- new id;
- new string[128];
- if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
- else if(sscanf(params, "u", id)) SCM(playerid,COLOR_ORANGE,"Usage:{FFFFFF} /goto [ID/Nick]");
- else if(!IsPlayerConnected(id)) SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
- else
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(playerid, x+1, y+1, z);
- if(IsPlayerInAnyVehicle(playerid))
- SetVehiclePos(GetPlayerVehicleID(playerid), x+2,y+2,z);
- PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
- format(string, sizeof(string), "You are teleported to {00D5FF}%s !", PlayerName(id));
- SCM(playerid,COLOR_GREY,string);
- }
- return 1;
- }
- CMD:o(playerid,params[])
- {
- new poruka[128], string2[128];
- if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
- if(sscanf(params, "s[128]", poruka)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /o [text]");
- format(string2, sizeof(string2), "(( Admin %s: %s ))", PlayerName(playerid), poruka);
- SCMToAll(LIGHTBLUE2, string2);
- return 1;
- }
- CMD:kill(playerid, params[])
- {
- new id, string[128];
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- if(sscanf(params,"u", id )) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /kill [ID/Nick] ");
- if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
- format(string, sizeof(string),"|A|Killed| %s are killed from %s",PlayerName(id), PlayerName(playerid));
- AdminMessage(0x99DD44FF,string);
- SetPlayerHealth(id, 0);
- format(string, sizeof(string),"|A|Killed| Your are killed from Administator %s", PlayerName(playerid));
- SCM(id,COLOR_RED, string);
- }
- else
- {
- SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
- }
- return 1;
- }
- //============================================================================//
- //============================================================================// PLAYER COMMANDS
- CMD:report(playerid, params[])
- {
- new string[128];
- if(isnull(params)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /report [question]");
- static chatspam[MAX_PLAYERS];
- if((gettime() - chatspam[playerid]) < 60)
- {
- SCM(playerid,COLOR_RED, "{B3B3B3}({FF0000}Stop!{B3B3B3}){FFFFFF} You can use report every 1min!");
- return 1;
- }
- chatspam[playerid] = gettime();
- foreach(Player,i)
- {
- if(PlayerInfo[i][pAdmin] > 0)
- {
- format(string, sizeof(string), " |R| %s[%d]: %s", PlayerName(playerid),playerid, params);
- SCM(i, COLOR_ORANGE, string);
- }
- }
- format(string,sizeof(string),"*Your report: {FFFFFF}%s",params);
- SCM(playerid,0xFFFF00FF,string);
- SCM(playerid,0xFFFF00FF,"Online administators whill give you a reply quickly");
- return 1;
- }
- CMD:help(playerid, params[])
- {
- SCM(playerid, LIGHTBLUE2, "Player Commands!");
- SCM(playerid, COLOR_ORANGE, "/report | In Construction");
- return 1;
- }
- //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment