20.02.2012, 12:31
Код HTML:
public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerConnect(playerid) { // Regular SetPVarInt(playerid,"LastID",-1); // Map Icons SetPlayerMapIcon(playerid, 1, -217.7419, 979.1485, 19.5035, 30, 1 ); // SHERIFF SetPlayerMapIcon(playerid, 2, -306.3210, 1055.0046, 19.7344, 20, 1); // EMS //============================================================================================== if(IsPlayerInRangeOfPoint(playerid,30,-2033.3695,-117.1875,1035.1719)) { SendClientMessage(playerid, COLOR_GREY,"Please do /buylicense to purchase a license"); } //============================================================================================== PLogged[playerid] = 0; new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if (!dini_Exists(file)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "RealityC Roleplay", "Welcome to RealityC Roleplay, you currently do not have an account, please register.", "Register", "Leave"); } if(fexist(file)) { ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "RealityC Roleplay", "Welcome to RealityC Roleplay, this account is in our database so please login", "Login", "Leave"); } return 1; } public OnPlayerDisconnect(playerid, reason) { new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(PLogged[playerid] == 1) { dini_IntSet(file,"Level",PInfo[playerid][LEVEL]); dini_IntSet(file,"Admin Level",PInfo[playerid][ADMINLEVEL]); dini_IntSet(file,"Wired",PInfo[playerid][WIRED]); dini_IntSet(file,"Jailed",PInfo[playerid][JAILED]); dini_IntSet(file,"Job",PInfo[playerid][JOB]); dini_IntSet(file,"Faction",PInfo[playerid][FACTION]); dini_IntSet(file,"Car",PInfo[playerid][CAR]); dini_IntSet(file,"Phone",PInfo[playerid][PHONE]); dini_IntSet(file,"Phonebook",PInfo[playerid][PHONEBOOK]); dini_IntSet(file,"Mask",PInfo[playerid][MASK]); dini_IntSet(file,"Condom",PInfo[playerid][CONDOM]); dini_IntSet(file,"Gun Skill",PInfo[playerid][GUNSKILL]); dini_IntSet(file,"Job Skill",PInfo[playerid][JOBSKILL]); dini_IntSet(file,"CarLic",PInfo[playerid][CARLIC]); dini_IntSet(file,"FlyLic",PInfo[playerid][FLYLIC]); dini_IntSet(file,"GunLic",PInfo[playerid][GUNLIC]); dini_IntSet(file,"Money",GetPlayerMoney(playerid)); dini_IntSet(file,"CopRank",PInfo[playerid][COPRANK]); dini_IntSet(file,"FBIRank",PInfo[playerid][FBIRANK]); dini_IntSet(file,"FireRank",PInfo[playerid][FIRERANK]); } PLogged[playerid] = 0; return 1; } public OnPlayerSpawn(playerid) { SetPlayerPos(playerid, -293.8833,1214.4150,30.9316); SendClientMessage(playerid, COLOR_GREY,"Check out our site at www.realityc.smfnew.com/"); PInfo[playerid][DEATH] = 0; if(PInfo[playerid][DEATH] == 1) { SetPlayerPos(playerid, -320.2311,1049.3833,20.3403); SendClientMessage(playerid, COLOR_GREY,"You have fully recovered from your accident."); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { PInfo[playerid][DEATH] = 1; SendClientMessageToAll(COLOR_RED,"SAN NEWS: A citizen of Fort Carson has died, please go to the funeral to share your love to our former citizen"); SendClientMessage(playerid, COLOR_GREY,"You have died, you must wait 5 minutes or less for the paramedics"); SetTimer("OnPlayerDeath1",300000,true); return 1; } forward OnPlayerDeath1(playerid); public OnPlayerDeath1(playerid) { SetPlayerHealth(playerid, 100); SetPlayerPos(playerid, -320.2311,1049.3833,20.3403); return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } /*============================================================================== =============================ADMIN COMMANDS!==================================== ================================================================================*/ COMMAND:explosion(playerid, params) { if(PInfo[playerid][ADMINLEVEL] >= 3) { SetTimer("OnPlayerExplosion",30000,false); SendClientMessage(playerid, COLOR_GREY,"Your explosion will start in 30 seconds, please be around the explosion so it is visible"); } return 1; } COMMAND:setadminlevel(playerid,params[]) { if(PInfo[playerid][ADMINLEVEL] >= 1337) { new adminlevel,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls new tmp[256], tmp2[256], Index,str[50];// creating the new variables tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),adminlevel = strval(tmp2);// setting them to strtok so we can use them as parameters of our command GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name format(file,sizeof(file),"RealityC/Users/%s.txt",n);//formatting the file if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setlevel <ID> <Level>");// if the string is empty if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID"); //if the id is not connected PInfo[id][ADMINLEVEL] = adminlevel;//sets the level of the player dini_IntSet(file, "Admin Level",adminlevel);//saves the new level to the file format(str,sizeof(str),"You have set %s's level to %d",n,adminlevel);//creates the string SendClientMessage(playerid,COLOR_LIGHTBLUE,str); } return 1; } COMMAND:setfaction(playerid,params[]) { if(PInfo[playerid][ADMINLEVEL] >= 5) { new faction,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls new tmp[256], tmp2[256], Index,str[50];// creating the new variables tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),faction = strval(tmp2);// setting them to strtok so we can use them as parameters of our command GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name format(file,sizeof(file),"RealityC/Users/%s.txt",n);//formatting the file if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setfaction <ID> <Level>");// if the string is empty if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID"); //if the id is not connected PInfo[id][FACTION] = faction;//sets the level of the player dini_IntSet(file, "Faction",faction);//saves the new level to the file format(str,sizeof(str),"You have set %s's faction to %d",n,faction);//creates the string SendClientMessage(playerid,COLOR_LIGHTBLUE,str); } return 1; } COMMAND:setcoprank(playerid,params[]) { if(PInfo[playerid][COPRANK] == 6 && PInfo[playerid][FACTION] == 1 || PInfo[playerid][ADMINLEVEL] >= 5) { new facrank,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls new tmp[256], tmp2[256], Index,str[50];// creating the new variables tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),facrank = strval(tmp2);// setting them to strtok so we can use them as parameters of our command GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name format(file,sizeof(file),"RealityC/Users/%s.txt",n);//formatting the file if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setcoprank <ID> <Level>");// if the string is empty if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID"); //if the id is not connected PInfo[id][COPRANK] = facrank;//sets the level of the player dini_IntSet(file, "CopRank",facrank);//saves the new level to the file format(str,sizeof(str),"You have set %s's faction rank to %d",n,facrank);//creates the string SendClientMessage(playerid,COLOR_LIGHTBLUE,str); } return 1; } COMMAND:setfirerank(playerid,params[]) { if(PInfo[playerid][FIRERANK] == 6 && PInfo[playerid][FACTION] == 3 || PInfo[playerid][ADMINLEVEL] >= 5) { new facrank,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls new tmp[256], tmp2[256], Index,str[50];// creating the new variables tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),facrank = strval(tmp2);// setting them to strtok so we can use them as parameters of our command GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name format(file,sizeof(file),"RealityC/Users/%s.txt",n);//formatting the file if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setcoprank <ID> <Level>");// if the string is empty if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID"); //if the id is not connected PInfo[id][FBIRANK] = facrank;//sets the level of the player dini_IntSet(file, "FireRank",facrank);//saves the new level to the file format(str,sizeof(str),"You have set %s's faction rank to %d",n,facrank);//creates the string SendClientMessage(playerid,COLOR_LIGHTBLUE,str); } return 1; } COMMAND:setfbirank(playerid,params[]) { if(PInfo[playerid][FBIRANK] == 6 && PInfo[playerid][FACTION] == 2 || PInfo[playerid][ADMINLEVEL] >= 5) { new facrank,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls new tmp[256], tmp2[256], Index,str[50];// creating the new variables tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),facrank = strval(tmp2);// setting them to strtok so we can use them as parameters of our command GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name format(file,sizeof(file),"RealityC/Users/%s.txt",n);//formatting the file if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setcoprank <ID> <Level>");// if the string is empty if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_GREY,"You have entered an incorrect ID"); //if the id is not connected PInfo[id][FBIRANK] = facrank;//sets the level of the player dini_IntSet(file, "FBIRank",facrank);//saves the new level to the file format(str,sizeof(str),"You have set %s's faction rank to %d",n,facrank);//creates the string SendClientMessage(playerid,COLOR_LIGHTBLUE,str); } return 1; } COMMAND:kick(playerid,params[]) { if(PInfo[playerid][ADMINLEVEL] >= 2) { new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME]; new tmp[256], Index, str[49]; tmp = strtok(params,Index), id = strval(tmp); GetPlayerName(id,on,sizeof(on)); GetPlayerName(playerid,n,sizeof(n)); if(PInfo[playerid][LEVEL] >= 2) return SendClientMessage(playerid,COLOR_ORANGE,"You need to be level 2 to use this command!"); if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /kick <ID> "); if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID"); format(str,sizeof(str),"%s has kicked %s",n,on); SendClientMessageToAll(COLOR_LIGHTBLUE,str); Kick(id); } return 1; } COMMAND:ban(playerid,params[]) { if(PInfo[playerid][ADMINLEVEL] >= 4) { new id, n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME]; new tmp[256], Index, str[49]; tmp = strtok(params,Index), id = strval(tmp); GetPlayerName(id,on,sizeof(on)); GetPlayerName(playerid,n,sizeof(n)); if(PInfo[playerid][LEVEL] >= 4) return SendClientMessage(playerid,COLOR_ORANGE,"You need to be level 4 to use this command!"); if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /ban <ID> "); if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID"); format(str,sizeof(str),"%s has banned %s",n,on); SendClientMessageToAll(COLOR_ORANGE,str); Ban(id); } return 1; } COMMAND:freeze(playerid,params[]) { if(PInfo[playerid][ADMINLEVEL] >= 2) { new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME]; new tmp[256], Index, str[49]; tmp = strtok(params,Index), id = strval(tmp); GetPlayerName(id,on,sizeof(on)); GetPlayerName(playerid,n,sizeof(n)); if(PInfo[playerid][LEVEL] >= 2) return SendClientMessage(playerid,COLOR_ORANGE,"You need to be level 2 to use this command!"); if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /freeze <ID> "); if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID"); format(str,sizeof(str),"%s has frozen %s",n,on); SendClientMessageToAll(COLOR_LIGHTBLUE,str); TogglePlayerControllable(playerid, 0); } return 1; } COMMAND:unfreeze(playerid,params[]) { if(PInfo[playerid][ADMINLEVEL] >= 1) { new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME]; new tmp[256], Index, str[49]; tmp = strtok(params,Index), id = strval(tmp); GetPlayerName(id,on,sizeof(on)); GetPlayerName(playerid,n,sizeof(n)); if(PInfo[playerid][LEVEL] >= 3) return SendClientMessage(playerid,COLOR_ORANGE,"You need to be level 3 to use this command!"); if(!strlen(params)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /freeze <ID> "); if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Invalid ID"); format(str,sizeof(str),"%s has frozen %s",n,on); SendClientMessageToAll(COLOR_LIGHTBLUE,str); TogglePlayerControllable(playerid, 1); } return 1; } COMMAND:admins(playerid, params) { new fAdmins[64]; if(PInfo[playerid][ADMINLEVEL] == 1) { fAdmins = "Donator"; } else if(PInfo[playerid][ADMINLEVEL] == 2) { fAdmins = "Basic Moderator"; } else if(PInfo[playerid][ADMINLEVEL] == 3) { fAdmins = "Head Moderator"; } else if(PInfo[playerid][ADMINLEVEL] == 4) { fAdmins = "Basic Administrator"; } else if(PInfo[playerid][ADMINLEVEL] == 5) { fAdmins = "Head Administrator"; } else if(PInfo[playerid][ADMINLEVEL] == 1337) { fAdmins = "Server Scripters"; } else if(PInfo[playerid][ADMINLEVEL] == 1338) { fAdmins = "Server Owner"; } new string[256]; new id, n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME]; GetPlayerName(id,on,sizeof(on)); GetPlayerName(playerid,n,sizeof(n)); SendClientMessage(playerid, COLOR_YELLOW,"______-=RealityC Roleplay Administration Team=-_______"); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); format(string, sizeof(string), "%s %s %d", fAdmins ,PlayerName2(playerid)); SendClientMessage(playerid, COLOR_RED,string); SendClientMessage(playerid, COLOR_GREY,"_______________________________________"); return 1; } COMMAND:achat(playerid, params[]) { if(PInfo[playerid][ADMINLEVEL] == 0) return SendClientMessage(playerid, COLOR_RED,"ERROR: You are not an administrator"); { new fAdmins[64]; if(PInfo[playerid][ADMINLEVEL] == 1) { fAdmins = "Donator"; } else if(PInfo[playerid][ADMINLEVEL] == 2) { fAdmins = "Basic Moderator"; } else if(PInfo[playerid][ADMINLEVEL] == 3) { fAdmins = "Head Moderator"; } else if(PInfo[playerid][ADMINLEVEL] == 4) { fAdmins = "Basic Administrator"; } else if(PInfo[playerid][ADMINLEVEL] == 5) { fAdmins = "Head Administrator"; } else if(PInfo[playerid][ADMINLEVEL] == 1337) { fAdmins = "Server Scripters"; } else if(PInfo[playerid][ADMINLEVEL] == 1338) { fAdmins = "Server Owner"; } new sendername[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "ADMIN CHAT: %s %s: %s", fAdmins, sendername, params[0]); SendAdminMessage(0xCCCCCC00, string); } return 1; } COMMAND:ah(playerid, params) { if(PInfo[playerid][ADMINLEVEL] >= 1) return SendClientMessage(playerid, COLOR_RED,"ERROR: You need to be administrator level 1 to view this command"); { SendClientMessage(playerid, COLOR_RED,"Administrator Help"); SendClientMessage(playerid, COLOR_RED,"List of admin commands: /level1, /level2, /level3, /level4, /level5, /level1337"); } return 1; } COMMAND:level1(playerid, params) { if(PInfo[playerid][ADMINLEVEL] >= 1) return SendClientMessage(playerid, COLOR_RED,"ERROR: You need to be administrator level 1 to view this command"); { SendClientMessage(playerid, COLOR_GREY,"/goto, /gethere"); return 1; } } COMMAND:level2(playerid, params) { if(PInfo[playerid][ADMINLEVEL] >= 1) return SendClientMessage(playerid, COLOR_RED,"ERROR: You need to be administrator level 1 to view this command"); { SendClientMessage(playerid, COLOR_GREY,"/goto, /gethere, /kick"); return 1; } } COMMAND:level3(playerid, params) { if(PInfo[playerid][ADMINLEVEL] >= 3) return SendClientMessage(playerid, COLOR_RED,"ERROR: You need to be administrator level 1 to view this command"); { SendClientMessage(playerid, COLOR_GREY,"/goto, /gethere, /kick, /weapcheck, "); SendClientMessage(playerid, COLOR_GREY,"Not lots of comands are functional yet, sorry."); return 1; } } COMMAND:level4(playerid, params) { if(PInfo[playerid][ADMINLEVEL] >= 3) return SendClientMessage(playerid, COLOR_RED,"ERROR: You need to be administrator level 1 to view this command"); { SendClientMessage(playerid, COLOR_GREY,"/goto, /gethere, /kick, /ban"); return 1; } } COMMAND:level5(playerid, params) { if(PInfo[playerid][ADMINLEVEL] >= 3) return SendClientMessage(playerid, COLOR_RED,"ERROR: You need to be administrator level 1 to view this command"); { SendClientMessage(playerid, COLOR_GREY,"/goto, /gethere, /kick, /ban, /setleader"); return 1; } } //================================================FACTION/JOB Radio=========================================== COMMAND:911(playerid, params[]) { if(PInfo[playerid][FACTION] == 1 || PInfo[playerid][FACTION] == 2) { new PlayerName[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "[911] %s: %s, over.", PlayerName, params[0]); SendCopsMessage(0xCCCCCC00, string); } return 1; } COMMAND:411(playerid, params[]) { if(PInfo[playerid][JOB] == 0) return SendClientMessage(playerid, COLOR_RED,"ERROR: You are not part of the Mechanic job"); { new sendername[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "Channel 911: %s %s", sendername, params[0]); SendJobMessage(0xCCCCCC00, string); } return 1; } //==================================================MECHANIC STUFF================================================== COMMAND:fix(playerid, params) { SetVehicleHealth(playerid, 100); SendClientMessage(playerid, COLOR_BLUE,"You have fixed the engine without any problems."); return 1; } //====================================================COP/FBI======================================================================== COMMAND:duty(playerid, params[]) { if(PInfo[playerid][FACTION] == 1) { SetPlayerColor(playerid, COLOR_BLUE); SetPlayerSkin(playerid, 280); GivePlayerWeapon(playerid, 24, 500); SendClientMessage(playerid, COLOR_RED,"You have taken your badge and nitestick out of your locker"); } else if(PInfo[playerid][FACTION] == 2) { SetPlayerColor(playerid, COLOR_BLUE); SetPlayerSkin(playerid, 280); GivePlayerWeapon(playerid, 24, 500); SendClientMessage(playerid, COLOR_RED,"You have taken your badge and nitestick out of your locker"); } else if(PInfo[playerid][FACTION] == 3) { SetPlayerColor(playerid, COLOR_BLUE); SetPlayerSkin(playerid, 277); GivePlayerWeapon(playerid, 24, 500); SendClientMessage(playerid, COLOR_RED,"You have taken your badge and nitestick out of your locker"); } return 1; } //============================================================================================================================== //=================================================LAW ENFORCEMENT COMMANDS===================================================== COMMAND:arrest(playerid, params[]) { new id, PlayerName[MAX_PLAYER_NAME], WantedName[MAX_PLAYER_NAME], fine, string[128], string2[128], string3[128]; if(sscanf(params,"udd", id, fine, time)) return SendClientMessage(playerid, 0xFF0000AA, "[Error] Usage: /arrest [Playerid] [Fine] [Time]"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player doesn't exist!"); if(PInfo[playerid][FACTION] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: You are not a police officer"); if(IsCuffed[id] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player is not cuffed!"); if(WantedLevel[id] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player is not wanted!"); if(!IsPlayerInRangeOfPoint(playerid, 20.0, 1528.2760,-1677.7377,5.8906)) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: You are not at the arrest point!"); if(!IsPlayerInRangeOfPoint(id, 20.0, 1528.2760,-1677.7377,5.8906)) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player is not at the arrest point!"); if(fine >= MAX_ARREST_FINE) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That fine is too high!"); if(fine <= MINIMUM_ARREST_FINE) return SendClientMessage(playerid, 0xFF0000AA, "[Error] That fine is too low!"); if(time >= MAX_ARREST_JAIL_TIME) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That time is too long!"); if(time <= MIN_ARREST_JAIL_TIME) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That time is too short!"); if(PInfo[playerid][FACTION] == 1 || PInfo[playerid][FACTION] == 2) { if(IsPlayerInRangeOfPoint(playerid, 20.0, 269.6075,82.7591,1001.0391) && IsPlayerInRangeOfPoint(id, 20.0, 269.6075,82.7591,1001.0391) && IsCuffed[id] == 1 && WantedLevel[id] >= 0) { GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); GetPlayerName(playerid, WantedName, sizeof(WantedName)); SetPlayerJailed(id); format(string, sizeof(string), "[Radio]: All units: %s has arrested %s for %d minutes and recieved $%d", PlayerName, WantedName,time, fine); SendCopsMessage(0xCCCCCC00, string); format(string2, sizeof(string2), "[Government]: You have been arrested by %s for %d minutes and lost $%d", PlayerName, time, fine); SendClientMessage(id, 0xFF0000AA, string2); format(string3, sizeof(string3), "[Succes]: You have arrested %s for %d minutes and gained $%d", WantedName, time, fine); SendClientMessage(playerid, 0xFF0000AA, string3); GivePlayerMoney(playerid, fine); GivePlayerMoney(id, -fine); } } return 1; } COMMAND:tazer(playerid, params[]) { new id; new Float:X,Float:Y,Float:Z; if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: Usage: /tazer [Playerid]"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player doesn't exist!"); if(IsCuffed[id] == 1) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player is already cuffed!"); if(PInfo[playerid][FACTION] == 0) { SendClientMessage(playerid, 0xFF0000AA, "[Error]: You are not a police officer!"); } if(PInfo[playerid][FACTION] == 1 || PInfo[playerid][FACTION] == 2) { GetPlayerPos(id, X, Y, Z); if(IsPlayerInRangeOfPoint(playerid, 20.0, X, Y, Z)) { TogglePlayerControllable(id, false); IsTazed[id] = 1; GameTextForPlayer(id, "~r~ tazed!", 4000, 4); taz = SetTimerEx("tazertimer", 7000, false, "u", id); SendClientMessage(playerid, 0xFF0000AA, "[Succes] You have tazed the player"); SendClientMessage(id, 0xFF0000AA, "[Government] You have been tazed by an officer"); } } return 1; } COMMAND:cuff(playerid, params[]) { new id, PlayerName[MAX_PLAYER_NAME], WantedName[MAX_PLAYER_NAME], string[128]; if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: Usage: /cuff [Playerid]"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player doesn't exist!"); if(PInfo[playerid][FACTION] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: You are not a police officer!"); if(IsCuffed[id] == 1) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player is already cuffed!"); if(IsTazed[id] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: You need to taze this player first!"); if(PInfo[playerid][FACTION] == 1 || PInfo[playerid][FACTION] == 1 && IsCuffed[id] == 0 || IsTazed[id] == 1) { IsCuffed[id] = 1; IsTazed[id] = 0; TogglePlayerControllable(id, false); GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); GetPlayerName(id, WantedName, sizeof(WantedName)); format(string, sizeof(string), "[Government]: You have been cuffed by officer %s", PlayerName); SendClientMessage(id, 0xFF0000AA, string); format(string, sizeof(string), "[Succes]: You have cuffed %s", WantedName); SendClientMessage(playerid, 0xFF0000AA, string); KillTimer(taz); Suspect[playerid][CUFF] = 1; } return 1; } COMMAND:uncuff(playerid, params[]) { new id, PlayerName[MAX_PLAYER_NAME], WantedName[MAX_PLAYER_NAME], string[128]; if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: Usage: /uncuff [Playerid]"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player doesn't exist!"); if(PInfo[playerid][FACTION] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: You are not a police officer!"); if(IsCuffed[id] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player is not cuffed"); else { IsCuffed[id] = 0; IsTazed[id] = 0; TogglePlayerControllable(id, true); GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); GetPlayerName(id, WantedName, sizeof(WantedName)); format(string, sizeof(string), "[Government]: You have been uncuffed by officer %s", PlayerName); SendClientMessage(id, 0xFF0000AA, string); format(string, sizeof(string), "[Succes]: You have uncuffed %s", WantedName); SendClientMessage(playerid, 0xFF0000AA, string); Suspect[playerid][CUFF] = 0; } return 1; } COMMAND:su(playerid, params[]) { new id; new reason[128]; if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: Usage: /su [Playerid] [Reason]"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player doesn't exist!"); if(PInfo[playerid][FACTION] == 0) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: You are not a police officer!"); if(GetPlayerWantedLevel(id) == 6) return SendClientMessage(playerid, 0xFF0000AA, "[Error]: That player is already most wanted!"); if(PInfo[playerid][FACTION] == 1 || PInfo[playerid][FACTION] == 2) { new PlayerName[MAX_PLAYER_NAME]; new WantedName[MAX_PLAYER_NAME]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); GetPlayerName(id, WantedName, sizeof(WantedName)); format(reason, sizeof (reason), "[Government]: %s has su'd %s for %s", PlayerName, WantedName, reason); SendClientMessageToAll(0xFF0000AA, reason); SetPlayerWantedLevel(id, GetPlayerWantedLevel(playerid) + 1); WantedLevel[id] = GetPlayerWantedLevel(playerid); Suspect[playerid][SUSPECT] = 1; } return 1; } COMMAND:m(playerid, params[]) { if(Cop[playerid][COPDUTY] == 1 || FBI[playerid][FBIDUTY] == 1 || PInfo[playerid][FACTION] == 3) { new sendername[MAX_PLAYER_NAME]; new string[512]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA, "Use /m "); format(string, sizeof(string), "MEGAPHONE: %s< %s", sendername, params[0]); ProxDetector(40.0, playerid, string, COLOR_YELLOW); } return 1; } ////////////////////////////////////////////////BASIC ROLEPLAYING COMANDS///////////////////////////////////// COMMAND:enter(playerid, params) { if(IsPlayerInRangeOfPoint(playerid,30,-145.1174,1116.1191,19.7500)) // MECHANIC { SetPlayerPos(playerid, 663.836242,-575.605407,16.343263); SetPlayerInterior(playerid, 0); } else if(IsPlayerInRangeOfPoint(playerid,3, -217.7564,979.0526,19.5034)) // Sheriff's Department { SetPlayerPos(playerid, 246.783996,63.900199,1003.640625); SetPlayerInterior(playerid, 6); } else if(IsPlayerInRangeOfPoint(playerid,30,-299.96633911133, 1011.7711181641, 19.59375)) // EMS { SetPlayerPos(playerid, -2641.0, 650.0, 75.4); // SetPlayerInterior(playerid, 0); // UNKNOWN! } else if(IsPlayerInRangeOfPoint(playerid,30, -97.4949,1149.7720,19.7422)) // DMV { SetPlayerPos(playerid, -2029.798339,-106.675910,1035.171875); SetPlayerInterior(playerid, 3); } else if(IsPlayerInRangeOfPoint(playerid,30, -207.3870,1119.3350,20.4297)) // Court { SetPlayerPos(playerid, 384.808624,173.804992,1008.382812); SetPlayerInterior(playerid, 3); } return 1; } COMMAND:buylicense(playerid, params) { if(IsPlayerInRangeOfPoint(playerid,1,-2033.3695,-117.1875,1035.1719)) SendClientMessage(playerid, COLOR_GREY,"Do /buycarlic, /buyflylic or /buygunlic, you must be in DMV to purchase"); return 1; } COMMAND:buyflylic(playerid, params) { if(IsPlayerInRangeOfPoint(playerid,1,-2033.3695,-117.1875,1035.1719)) { SendClientMessage(playerid, COLOR_GREY,"You bought a plane license"); PInfo[playerid][FLYLIC] = 1; GivePlayerMoney(playerid, -7000); } return 1; } COMMAND:buygunlic(playerid, params) { if(IsPlayerInRangeOfPoint(playerid,1,-2033.3695,-117.1875,1035.1719)) { SendClientMessage(playerid, COLOR_GREY,"You bought a gun license"); PInfo[playerid][GUNLIC] = 1; GivePlayerMoney(playerid, -10000); } return 1; } COMMAND:buycarlic(playerid, params) { if(IsPlayerInRangeOfPoint(playerid,1,-2033.3695,-117.1875,1035.1719)) { SendClientMessage(playerid, COLOR_GREY,"You bought a gun license"); PInfo[playerid][CARLIC] = 1; GivePlayerMoney(playerid, -3000); } return 1; } COMMAND:exit(playerid, params) { if(IsPlayerInRangeOfPoint(playerid,30,663.836242,-575.605407,16.343263)) // MECHANIC { SetPlayerPos(playerid, -145.1174,1116.1191,19.7500); SetPlayerInterior(playerid, 0); } else if(IsPlayerInRangeOfPoint(playerid,3,246.783996,63.900199,1003.640625)) // Sheriff's Department { SetPlayerPos(playerid, -217.7564,979.0526,19.5034); SetPlayerInterior(playerid, 0); } else if(IsPlayerInRangeOfPoint(playerid,30,-2641.0, 650.0, 50.4)) // EMS { SetPlayerPos(playerid, -299.96633911133, 1011.7711181641, 19.59375 ); SetPlayerInterior(playerid, 0); } else if(IsPlayerInRangeOfPoint(playerid,30,-2029.6281,-106.6850,1035.1719)) // DMV { SetPlayerPos(playerid, -97.4949,1149.7720,19.7422); SetPlayerInterior(playerid, 0); } else if(IsPlayerInRangeOfPoint(playerid,30,384.808624,173.804992,1008.382812)) // City Hall { SetPlayerPos(playerid, -207.3870,1119.3350,20.4297); SetPlayerInterior(playerid, 0); } return 1; } COMMAND:stats(playerid, params) { new fJob[24]; if(PInfo[playerid][JOB] == 1) { fJob = "Mechanic"; } new fAction[64]; if(PInfo[playerid][FACTION] == 1) { fAction = "Sheriff's Department"; } else if(PInfo[playerid][FACTION] == 2) { fAction = "Federal Bureau of Investigation"; } else if(PInfo[playerid][FACTION] == 3) { fAction = "Fire Department"; } new fAcRank[126]; if(PInfo[playerid][COPRANK] == 1) { fAcRank = "Trainee"; } else if(PInfo[playerid][COPRANK] == 2) { fAcRank = "Cadet"; } else if(PInfo[playerid][COPRANK] == 3) { fAcRank = "Trainee"; } else if(PInfo[playerid][COPRANK] == 4) { fAcRank = "Deputy"; } else if(PInfo[playerid][COPRANK] == 5) { fAcRank = "Corporal"; } else if(PInfo[playerid][COPRANK] == 6) { fAcRank = "Sergeant"; } else if(PInfo[playerid][COPRANK] == 7) { fAcRank = "Undersheriff"; } else if(PInfo[playerid][COPRANK] == 8) { fAcRank = "Chief"; } new fBRank[126]; if(PInfo[playerid][FBIRANK] == 1) { fAcRank = "Trainee"; } else if(PInfo[playerid][FBIRANK] == 2) { fBRank = "Cadet"; } else if(PInfo[playerid][FBIRANK] == 3) { fBRank = "Member"; } else if(PInfo[playerid][FBIRANK] == 4) { fBRank = "Division Helper"; } else if(PInfo[playerid][FBIRANK] == 5) { fBRank = "Sub-Commander"; } else if(PInfo[playerid][FBIRANK] == 6) { fBRank = "Commander"; } else if(PInfo[playerid][FBIRANK] == 7) { fBRank = "Sub-Director"; } else if(PInfo[playerid][FBIRANK] == 8) { fBRank = "Director"; } new firecRank[126]; if(PInfo[playerid][FIRERANK] == 1) { firecRank = "Trainee"; } else if(PInfo[playerid][FIRERANK] == 2) { firecRank = "Cadet"; } else if(PInfo[playerid][FIRERANK] == 3) { firecRank = "Trainee"; } else if(PInfo[playerid][FIRERANK] == 4) { firecRank = "Member"; } else if(PInfo[playerid][FIRERANK] == 5) { firecRank = "Head EMS"; } else if(PInfo[playerid][FIRERANK] == 6) { firecRank = "Sub-Commander"; } else if(PInfo[playerid][FIRERANK] == 7) { firecRank = "Division Commander"; } else if(PInfo[playerid][FIRERANK] == 8) { firecRank = "Leader"; } new fLevel[24]; if(PInfo[playerid][LEVEL] == 0) { fLevel = "None"; } else if(PInfo[playerid][LEVEL] == 1) { fLevel = "1"; } new fALevel[24]; if(PInfo[playerid][ADMINLEVEL] == 1) { fALevel = "1"; } else if(PInfo[playerid][ADMINLEVEL] == 2) { fALevel = "2"; } else if(PInfo[playerid][ADMINLEVEL] == 3) { fALevel = "3"; } else if(PInfo[playerid][ADMINLEVEL] == 4) { fALevel = "4"; } else if(PInfo[playerid][ADMINLEVEL] == 5) { fALevel = "5"; } else if(PInfo[playerid][ADMINLEVEL] == 1337) { fALevel = "1337"; } else if(PInfo[playerid][ADMINLEVEL] == 1338) { fALevel = "1338"; } new fDuty[24]; if(Cop[playerid][COPDUTY] == 0) { fDuty = "No"; } else if(Cop[playerid][COPDUTY] == 1) { fDuty = "Yes"; } else if(FBI[playerid][FBIDUTY] == 0) { fDuty = "No"; } else if(FBI[playerid][FBIDUTY] == 1) { fDuty = "Yes"; } new pName[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, pName, sizeof pName); SendClientMessage(playerid, COLOR_GREY,"______-=Information on Account=-_______"); format(string, sizeof(string), "| Name: %s | Level [%s] | Admin Level [%s] | Money [%s] |", pName, fLevel, fALevel, GetPlayerMoney(playerid)); SendClientMessage(playerid, COLOR_GREY,string); format(string, sizeof(string), "| Job [%s] | Law Job [%s] | Duty [%s] | Rank [%s%s%s] |", fJob, fAction, fDuty, fAcRank, firecRank, fBRank); SendClientMessage(playerid, COLOR_GREY,string); SendClientMessage(playerid, COLOR_GREY,"_______________________________________"); return 1; } COMMAND:licenses(playerid, params) { new pName[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, pName, sizeof pName); new text1[20]; new text2[20]; new text3[20]; new text4[20]; new text5[20]; new text6[20]; if(PInfo[playerid][CARLIC] == 1) { text1 = "Passed"; } else { text4 = "Not Passed"; } if(PInfo[playerid][GUNLIC] == 1) { text2 = "Passed"; } else { text5 = "Not Passed"; } if(PInfo[playerid][FLYLIC] == 1) { text3 = "Passed"; } else { text6 = "Not Passed"; } SendClientMessage(playerid, COLOR_GREY,"______-=Information Licenses=-_______"); format(string, sizeof(string), "Name : %s", pName); SendClientMessage(playerid, COLOR_GREY,string); format(string, sizeof(string), "Drivers License : %s", text1); SendClientMessage(playerid, COLOR_GREY,string); format(string, sizeof(string), "Gun License : %s", text2); SendClientMessage(playerid, COLOR_GREY,string); format(string, sizeof(string), "Flying License : %s", text3); SendClientMessage(playerid, COLOR_GREY,string); SendClientMessage(playerid, COLOR_GREY,"_______________________________________"); return 1; } COMMAND:help(playerid, params) { SendClientMessage(playerid, COLOR_WHITE,":: GENERAL :: /login, /register, /b, /o(oc), /report"); SendClientMessage(playerid, COLOR_WHITE,":: BANK :: /pay, /deposit, /withdraw, /paycheck"); SendClientMessage(playerid, COLOR_WHITE,":: REGULAR :: /stats, /licenses, /n(ewbie)"); SendClientMessage(playerid, COLOR_WHITE,":: HELP :: /cellphonehelp, /insurancehelp, /licensehelp"); SendClientMessage(playerid, COLOR_WHITE,"If you have a suggestion please post on the forums, or talk to the server owner. Thank you!"); if(Cop[playerid][COPDUTY] == 1 || FBI[playerid][FBIDUTY] == 1) SendClientMessage(playerid, COLOR_YELLOW,":: COP :: /taze, /untaze, /duty, /offduty, /cuff, /uncuff, /911 (Department), /arrest"); if(Cop[playerid][COPDUTY] == 1 || FBI[playerid][FBIDUTY] == 1) SendClientMessage(playerid, COLOR_YELLOW,":: FBI :: /taze, /untaze, /fbiduty, /offduty, /cuff, /uncuff, /911 (Department), /arrest"); else if(PInfo[playerid][JOB] == 1) SendClientMessage(playerid, COLOR_GREY,":: MECHANIC :: /repair"); return 1; } COMMAND:me(playerid, params[]) { new sendername[MAX_PLAYER_NAME]; new string[128]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA, "Use /me to do an action."); format(string, sizeof(string), "%s %s", sendername, params); ProxDetector(10.0, playerid, string, COLOR_PURPLE); return 1; } COMMAND:do(playerid, params[]) { new sendername[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA, "Use /do to do an action."); format(string, sizeof(string), "%s ((%s))", params, sendername); ProxDetector(10.0, playerid, string,COLOR_PURPLE); return 1; } COMMAND:b(playerid, params[]) { new sendername[MAX_PLAYER_NAME]; new string[128]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "Use /b (local OOC)"); format(string, sizeof(string), "(( %s %s ))", sendername, params); ProxDetector(20.0, playerid, string, COLOR_WHITE); return 1; } COMMAND:n(playerid, params[]) { new sendername[MAX_PLAYER_NAME]; new string[128]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "Use /n (question)"); format(string, sizeof(string), "%s: %s", sendername, params); ProxDetector(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999.0, playerid, string, COLOR_RED); return 1; } COMMAND:o(playerid, params[]) { new sendername[MAX_PLAYER_NAME]; new string[256]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "Use /o (Global OOC)"); format(string, sizeof(string), "OOC: %s (( %s ))", sendername, params); ProxDetector(9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999.0, playerid, string, COLOR_WHITE); return 1; } COMMAND:ooc(playerid, params) { return cmd_ooc(playerid, params); }