Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ohmy: IM ALLREADY CREATE THE FOLDER DIRECTORY TOO
- // ohmy: THE COMPILING IS SUCCESS WITHOUT ANY ERROR OR WARNING
- // ohmy: BUT IT NOT CREATE THE .INI FILE
- // ohmy: I USE A BIT OF INFINITY90 CMD
- // Includes
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <foreach>
- #include <sscanf>
- // Login Dialogs
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_SUCCESS_1 3
- #define DIALOG_SUCCESS_2 4
- // Where The Userfile Gets Created!
- #define PATH "/Users/%s.ini"
- // New
- new teleports;
- // Colours
- #define COLOR_WHITE "{FFFFFF}"
- #define COLOR_RED "{F81414}"
- #define COLOR_GREEN "{00FF22}"
- #define COLOR_LIGHTBLUE "{00CED1}"
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GGREEN 0x33AA33AA
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_ORANGE 0xFF8C00AA
- #define COLOR_DRED 0xFF0000AA
- #define COLOR_BROWN 0x654321AA
- // Forwards!
- forward SendStaffMessage(color, string[]);
- // Stats / Saves
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pKills,
- pDeaths,
- pScore,
- pMuted
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- // Loading / Finding The Players Data Once Login
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Int("Score",PlayerInfo[playerid][pScore]);
- INI_Int("Muted",PlayerInfo[playerid][pMuted]);
- return 1;
- }
- // The Location Of Players File
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- // Hashes The Players Passwords!
- 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;
- }
- public SendStaffMessage(color, string[])
- {
- foreach(Player, i)
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- main()
- print("\n--------------------------------------");
- print(" Infinty90 Register / Admin System! ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Enter Your Password You Registered With!","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Register Below",""COLOR_WHITE"Enter A Password To Register And Play!","Register","Quit");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
- INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted]);
- INI_Close(File);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pKills]++;
- PlayerInfo[playerid][pDeaths]++;
- PlayerInfo[killerid][pScore] = 1;
- PlayerInfo[playerid][pScore] = -1;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- CMD:a(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new admin[128];
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- if(PlayerInfo[playerid][pAdmin] == 1) format(admin, sizeof(admin), "[Admin Chat] (Level 1 Admin) %s: %s", Name, params);
- else if(PlayerInfo[playerid][pAdmin] == 2) format(admin, sizeof(admin), "[Admin Chat] (Level 2 Admin) %s: %s", Name, params);
- else if(PlayerInfo[playerid][pAdmin] == 3) format(admin, sizeof(admin), "[Admin Chat] (Level 3 Admin) %s: %s", Name, params);
- else if(PlayerInfo[playerid][pAdmin] == 4) format(admin, sizeof(admin), "[Admin Chat] (Level 4 Admin) %s: %s", Name, params);
- SendStaffMessage(COLOR_GGREEN, admin);
- }
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new targetid, reason;
- new VBName[MAX_PLAYER_NAME];
- new VBName1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /kick [playerid] [reason]");
- if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Yourself!");
- if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
- else
- {
- new str[128];
- format(str, sizeof(str), "Administrator %s Has Kicked %s Reason: %d!", VBName, VBName1, reason);
- SendClientMessageToAll(COLOR_DRED,str);
- Kick(targetid);
- }
- }
- else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
- return 1;
- }
- CMD:makeadmin(playerid, params[]) {
- if(PlayerInfo[playerid][pAdmin] >= 4) {
- new VBName[MAX_PLAYER_NAME];
- new VBName1[MAX_PLAYER_NAME];
- new targetid;
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
- new
- iAdminValue,
- iTargetID;
- if(sscanf(params, "di", iTargetID, iAdminValue)) {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /makeadmin [playerid] [level]");
- }
- else if(IsPlayerConnected(iTargetID)) {
- new
- szMessage[47 + (MAX_PLAYER_NAME * 2)];
- if(iAdminValue < 0 || iAdminValue > 4) return SendClientMessage(playerid, COLOR_PURPLE, "Valid range is 0 - 8.");
- PlayerInfo[iTargetID][pAdmin] = iAdminValue;
- format(szMessage, sizeof(szMessage), "Administrator %s has promoted %s to a level %d admin.", VBName, VBName1, iAdminValue);
- SendStaffMessage(COLOR_PURPLE,szMessage);
- format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, VBName);
- SendClientMessage(iTargetID, COLOR_PURPLE, szMessage);
- format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", VBName1,iAdminValue);
- SendClientMessage(playerid, COLOR_PURPLE, szMessage);
- }
- else SendClientMessage(playerid, COLOR_PURPLE, "Invalid player specified.");
- }
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new targetid, reason;
- new VBName[MAX_PLAYER_NAME];
- new VBName1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_DRED,"Usage: /Ban [playerid] [reason]");
- if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Ban Yourself!");
- if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
- else
- {
- new str[128];
- format(str, sizeof(str), "Administrator %s Has Banned %s Reason: %d!", VBName, VBName1, reason);
- SendClientMessageToAll(COLOR_DRED,str);
- Ban(targetid);
- }
- }
- else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
- return 1;
- }
- CMD:banip(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- new
- type[ 128 ],
- string[ 128 ]
- ;
- if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "Usage: /banip [IP]");
- else
- {
- format(string, sizeof(string),"banip %s", type);
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- }
- return true;
- }
- return 1;
- }
- CMD:unbanip(playerid, params[])
- {
- new type[128],string[128];
- new VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "USAGE: /Unbanip [Players IP]");
- else
- {
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- format(string, sizeof(string),"unbanip %s", type);
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- format(string, sizeof(string), "Administrator: %s has unbanned IP %s", VBName, type);
- SendStaffMessage(-1,string);
- }
- else
- {
- return SendClientMessage(playerid, -1 ,"You dont have access!");
- }
- }
- return true;
- }
- CMD:clearchat(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_DRED, "ERROR: You must be level 1 to use this command!" );
- {
- new string[128], VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll(COLOR_PURPLE, " " );
- format(string,sizeof(string),"The Server Chat Has Been Cleared By Administrator %s", VBName);
- SendClientMessageToAll(COLOR_DRED, string);
- return 1;
- }
- }
- CMD:givemoney(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 3)
- {
- new string[128], giveplayerid, money;
- new VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "dd", giveplayerid, money)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /givemoney [playerid] [money]");
- if(IsPlayerConnected(giveplayerid))
- {
- GivePlayerMoney(giveplayerid, money);
- format(string, sizeof(string), "[ADMIN] %s has given %s $%d.", VBName, VBName1, money);
- SendStaffMessage(COLOR_DRED, string);
- }
- }
- return 1;
- }
- CMD:pos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- new Float: pos[3], int;
- if(sscanf(params, "fffd", pos[0], pos[1], pos[2], int)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /pos [x coordinate] [y coordinate] [z coordinate] [interior]");
- SendClientMessage(playerid, COLOR_PURPLE, "You have teleported!");
- SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- SetPlayerInterior(playerid, int);
- }
- return 1;
- }
- CMD:teleports(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- ShowPlayerDialog(playerid,teleports, DIALOG_STYLE_LIST,"Teleports List For Admins","Los Santos\nSan Fierro\nLas Venturas","Teleport!","Cancel");
- return 1;
- }
- return 1;
- }
- CMD:jetpack(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
- new string[128];
- new VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- format(string, sizeof(string), "[ADMIN] %s gave themself a jetpack.", VBName);
- SendStaffMessage(COLOR_DRED, string);
- return 1;
- }
- return 1;
- }
- CMD:armour(playerid, params[])
- {
- new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "dd", playa, health))
- {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /armour [playerid] [armor]");
- return 1;
- }
- if (PlayerInfo[playerid][pAdmin] >= 3)
- {
- if(IsPlayerConnected(playa))
- {
- if(playa != INVALID_PLAYER_ID)
- {
- SetPlayerArmour(playa, health);
- format(string, sizeof(string), "[ADMIN] %s set %s's armour to %d.", VBName, VBName1, health);
- SendStaffMessage(COLOR_DRED, string);
- }
- }
- }
- return 1;
- }
- CMD:health(playerid, params[])
- {
- new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "dd", playa, health))
- {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /health [playerid] [armor]");
- return 1;
- }
- if (PlayerInfo[playerid][pAdmin] >= 3)
- {
- if(IsPlayerConnected(playa))
- {
- if(playa != INVALID_PLAYER_ID)
- {
- SetPlayerHealth(playa, health);
- format(string, sizeof(string), "[ADMIN] %s set %s's armour to %d.", VBName, VBName1, health);
- SendStaffMessage(COLOR_DRED, string);
- }
- }
- }
- return 1;
- }
- CMD:car(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- new
- iVehicle,
- iColors[2];
- if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1]))
- {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /veh [Car ID] [Colour 1] [Colour 2]");
- }
- else if(!(400 <= iVehicle <= 611))
- {
- SendClientMessage(playerid, COLOR_PURPLE, "No Such Vehicle Model (400 - 611)");
- }
- else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255))
- {
- SendClientMessage(playerid, COLOR_PURPLE, "No Such Colour (0 - 255)");
- }
- new
- Float: fVehPos[4];
- GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
- GetPlayerFacingAngle(playerid, fVehPos[3]);
- CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
- return SendClientMessage(playerid, COLOR_PURPLE, "Your Vehicle Has Spawned!");
- }
- return 1;
- }
- CMD:cnn(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- if(!isnull(params))
- {
- new
- szMessage[128];
- new VBName [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "~b~%s: ~w~%s",VBName, params);
- foreach(Player, i) GameTextForPlayer(i, szMessage, 5000, 6);
- }
- else SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /cnn [message]. ~n~ = new line, ~r~ = red, ~g~ = green, ~b~ = blue, ~w~ = white, ~y~ = yellow.");
- }
- else SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
- return 1;
- }
- CMD:report(playerid, params[])
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOR_DRED, "USAGE: /report [reason]");
- new string[120];
- new VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- format(string, sizeof(string), "%s Has Reported %s", VBName, params);
- SendStaffMessage(COLOR_ORANGE, string);
- return 1;
- }
- CMD:general(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_DRED," /report");
- return 1;
- }
- CMD:mute(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- new string[128], giveplayerid;
- new VBName [MAX_PLAYER_NAME];
- new VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /mute [playerid]");
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid == playerid)
- {
- SendClientMessage(playerid, COLOR_PURPLE, "You can not use this command on yourself!");
- return 1;
- }
- if(PlayerInfo[giveplayerid][pMuted] == 0)
- {
- if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
- {
- format(string, sizeof(string), "%s just tried to /mute you.",VBName);
- SendClientMessage(giveplayerid, COLOR_PURPLE, string);
- SendClientMessage(playerid, COLOR_PURPLE, "You can't perform this action on an equal or higher level administrator.");
- return 1;
- }
- PlayerInfo[giveplayerid][pMuted] = 1;
- format(string, sizeof(string), "[ADMIN] %s was silenced by %s.",VBName1,VBName);
- SendStaffMessage(COLOR_PURPLE,string);
- }
- else
- {
- PlayerInfo[giveplayerid][pMuted] = 0;
- format(string, sizeof(string), "[ADMIN] %s was unsilenced by %s.",VBName1,VBName);
- SendStaffMessage(COLOR_PURPLE,string);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_DRED, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:hit(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 2)
- {
- new string[128], giveplayerid;
- new VBName [MAX_PLAYER_NAME];
- new VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /hit [playerid]");
- new Float:shealth;
- new Float:slx, Float:sly, Float:slz;
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerHealth(giveplayerid, shealth);
- SetPlayerHealth(giveplayerid, shealth-5);
- GetPlayerPos(giveplayerid, slx, sly, slz);
- SetPlayerPos(giveplayerid, slx, sly, slz+5);
- PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
- format(string, sizeof(string), "[ADMIN] %s was slapped by %s",VBName1, VBName);
- SendStaffMessage(COLOR_PURPLE,string);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:ah(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- SendClientMessage(playerid, COLOR_GGREEN,"LEVEL 1 Administrator: /a /kick /ban /freeze /unfreeze /cnn /report");
- }
- if(PlayerInfo[playerid][pAdmin] >= 2)
- {
- SendClientMessage(playerid, COLOR_DRED,"LEVEL 2 Administrator: /clearchat /teleports /pos /car /hit");
- }
- if(PlayerInfo[playerid][pAdmin] >= 3)
- {
- SendClientMessage(playerid, COLOR_DRED,"LEVEL 3 Administrator: /jetpack /banip /unbanip /givemoney /health /armour ");
- }
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- SendClientMessage(playerid, COLOR_DRED,"LEVEL 4 Administrator: /makeadmin /giftall");
- }
- return 1;
- }
- CMD:giftall(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 4)
- {
- if(IsPlayerConnected(playerid))
- {
- if(isnull(params))
- {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /giftall [Confirm]");
- SendClientMessage(playerid, COLOR_DRED, "This Will Give Everyone $10,000, +10 Score, Full Health And Armour!");
- return 1;
- }
- if(strcmp(params,"confirm",true) == 0)
- {
- foreach(Player, i)
- {
- SetPlayerHealth(i,100);
- SetPlayerArmour(i,100);
- GivePlayerMoney(i,10000);
- SetPlayerScore(i,10);
- }
- return 1;
- }
- }
- }
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /freeze [playerid]");
- TogglePlayerControllable(giveplayerid, 0);
- format(string, sizeof(string),"Administrator %s Has Frozen %s", VBName, VBName1);
- SendStaffMessage(COLOR_DRED, string);
- return 1;
- }
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /unfreeze [playerid]");
- TogglePlayerControllable(giveplayerid, 1);
- format(string, sizeof(string),"Administrator %s Has Unfrozen %s", VBName, VBName1);
- SendStaffMessage(COLOR_DRED, string);
- return 1;
- }
- 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)
- {
- 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[])
- {
- switch( dialogid )
- {
- case DIALOG_REGISTER:
- {
- if (!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COLOR_WHITE"Register Below",""COLOR_RED"Wrong Password!\n"COLOR_WHITE"Enter Password To Play!","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_Close(File);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COLOR_WHITE"Success!",""COLOR_GREEN"Your Account Is Now In Our Database! Thanks For Registering","Ok","");
- }
- }
- case DIALOG_LOGIN:
- {
- if ( !response ) return Kick ( playerid );
- if( response )
- {
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COLOR_WHITE"Success!",""COLOR_GREEN"You have successfully logged in!","Ok","");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_RED"You have entered an incorrect password.\n"COLOR_WHITE"Type your password below to login.","Login","Quit");
- }
- return 1;
- }
- }
- }
- if(dialogid == teleports)
- {
- if(listitem == 0)
- {
- SetPlayerPos(playerid, 1485.9170,-1730.4979,13.0973);
- SendClientMessage(playerid, COLOR_PURPLE,"You've Teleported To Los Santos");
- return 1;
- }
- if(listitem == 1)
- {
- SetPlayerPos(playerid, -1417.0,-295.8,14.1);
- SendClientMessage(playerid, COLOR_PURPLE,"You've Teleported To San Fierro");
- return 1;
- }
- if(listitem == 2)
- {
- SetPlayerPos(playerid, 1699.2,1435.1, 10.7);
- SendClientMessage(playerid, COLOR_PURPLE,"You've Teleported To Las Venturas");
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment