#include #include #include #include #include #define dcmd(%1,%2,%3) if ((strcmp(%3, "/%1", true, %2+1) == 0)&&(((%3[%2+1]==0)&&(dcmd_%1(playerid,"")))||((%3[%2+1]==32)&&(dcmd_%1(playerid,%3[%2+2]))))) return 1 #define COLOR_SYSTEM 0xAA3333AA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xAA3333AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_ORANGE 0xFF9900AA #define COLOUR_PERSONAL 0x8080FFAA #define COLOUR_IMPORTANT 0xFF0000AA #define COLOUR_GLOBAL 0xD0D0FFAA #define COLOUR_BROADCAST 0x0066CCAA #define COLOUR_QUERY 0xFFFFFFFF #define NUM_PLOTS 20 #define GAME_TEXT_STYLE_BIG 6 #define GAME_TEXT_STYLE_SMALL 4 #define PocketMoney 5000 // Amount player recieves on spawn. #define INACTIVE_PLAYER_ID 255 #define GIVECASH_DELAY5000 // Time in ms between /givecash commands. #define NUMVALUES 4 #define CP_BANK 0 #define CP_PIRATE 1 #define CP_AMMU 2 #define CP_ADMIN 11 #define CP_DRAGON 3 #define CP_SEXSHOP 4 #define CP_BAR 5 #define CP_CALIGULA 6 #define CP_ZIP 7 #define CP_BINCO 8 #define CP_TATOO 9 #define CP_BOTIQUE 10 #define P_DRAGON 0 #define P_SEXSHOP 1 #define P_BAR 2 #define P_CALIGULA 3 #define P_ZIP 4 #define P_BINCO 5 #define P_TATOO 6 #define P_BOTIQUE 7 #define TEAM_COP 1 #define P_OFFSET 3 forward MoneyGrubScoreUpdate(); forward SavePosTimer(playerid); forward AdminArea(playerid); forward UpdateSpeed(playerid); forward SendTextTimer(); forward Givecashdelaytimer(playerid); //forward GrubModeReset(); forward SetPlayerRandomSpawn(playerid); forward SetupPlayerForClassSelection(playerid); forward GameModeExitFunc(); //------------------------------------------------------------------------------------------------------ //new gTeam[MAX_PLAYERS]; /** SPEED SHOW @ FILE NOW! **/ new speedwarned[MAX_PLAYERS]; new job[MAX_PLAYERS]; new player_op[MAX_PLAYERS]; new ownedcar[MAX_PLAYERS]; new owner[MAX_PLAYERS]; new FreezeTimer; new Frozen[MAX_PLAYERS]; new Float:frozex,Float:frozey,Float:frozez; new Float:player_plot_x[MAX_PLAYERS][NUM_PLOTS]; new Float:player_plot_y[MAX_PLAYERS][NUM_PLOTS]; //new Float:player_plot_z[MAX_PLAYERS][NUM_PLOTS]; new CashScoreOld; new iSpawnSet[MAX_PLAYERS]; new bank[MAX_PLAYERS]; new bounty[MAX_PLAYERS]; new playerCheckpoint[MAX_PLAYERS]; new gambleWarning[MAX_PLAYERS]; new savePos; new worldTime; new playerColors[100] = { 0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,0xEE82EEFF,0xFFD720FF, 0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF, 0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF, 0x275222FF,0xF09F5BFF,0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF, 0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,0x4B8987FF, 0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF, 0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF, 0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF, 0x9F945CFF,0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF, 0x3FE65CFF }; new Float:gRandomPlayerSpawns[2][0] = { {1682.4164,1446.8452,10.7722}, {1662.4164,1446.8452,10.7722} }; new Float:gCopPlayerSpawns[2][0] = { {2297.1064,2452.0115,10.8203}, {2297.0452,2468.6743,10.8203} }; /*new SkinID[7] = { 49, 51, 68, 74, 85, 47, 99 };*/ #define MAX_POINTS 11 new Float:checkCoords[MAX_POINTS][4] = { {-36.5483,-57.9948, -17.2655,-49.2967}, //BANK {1894.6128,1445.3431, 2084.9739,1637.8186}, //PIRATE {284.0546,-86.4384, 302.9315,-56.6674}, //AMMUNATION {1925.1511,968.2358, 2019.0715,1067.4276}, //DRAGON {-115.9544,-24.2706, -99.1631,-7.1391}, //SEXSHOP {487.6558,-88.5900, 512.0635, -67.7503}, //BAR {2216.7971,1638.0493, 2255.2097,1714.0806}, //CALIGULA {144.9131,-96.0927, 177.4128,-70.7923}, //ZIP {201.4462,-112.4556, 218.5237,-95.1238}, //BINCO {-204.7623,-44.0326, -200.2330,-39.8128}, //TATOO {416.7485,-84.4242, 422.6890,-74.0611} //BOTIQUE }; new Float:checkpoints[MAX_POINTS][3] = { {-22.2549,-55.6575,1003.5469}, {2000.3132,1538.6012,13.5859}, {291.0004,-84.5168,1001.5156}, {1989.0619,1005.5241,994.4688}, {-103.5525,-22.4661,1000.7188}, {501.4927,-75.4323,998.7578}, {2235.5408,1679.0402,1008.3594}, {161.1875,-79.9915,1001.8047}, {207.5640,-97.8188,1005.2578}, {-203.4864,-41.2045,1002.2734}, {418.5547,-80.1667,1001.8047} }; new checkpointType[MAX_POINTS] = { CP_BANK, CP_PIRATE, CP_AMMU, CP_DRAGON, CP_SEXSHOP, CP_BAR, CP_CALIGULA, CP_ZIP, CP_BINCO, CP_TATOO, CP_BOTIQUE }; #define MAX_PROPERTIES 8 new propertyNames[MAX_PROPERTIES][32] = { "Four Dragons", "Sex Shop", "Shithole Bar", "Caligula", "Zip Shop", "Binco Shop", "Tatoo Parlor", "Botique" }; new propertyValues[MAX_PROPERTIES] = { 75000, 25000, 20000, 100000, 15000, 15000, 10000, 20000 }; new propertyEarnings[MAX_PROPERTIES] = { 5000, 2000, 1500, 7000, 1000, 1000, 700, 1500 }; new propertyOwner[MAX_PROPERTIES] = {999,999,999,999,999,999,999,999}; #define MAX_WEAPONS 7 new weaponNames[MAX_WEAPONS][32] = { "Shotgun", "Combat Shotgun", "Micro Uzi", "Tec9", "MP5", "AK47", "M4" }; new weaponIDs[MAX_WEAPONS] = { 25, //Shotgun 27, //Combat shotgun 28, //Micro Uzi 32, //Tec9 29, //MP5 30, //AK47 31 //M4 }; new weaponCost[MAX_WEAPONS] = { 7000, 15000, 7000, 5000, 15000, 25000, 30000 }; new weaponAmmo[MAX_WEAPONS] = { 15, 20, 120, 120, 120, 120, 120 }; new playerWeapons[MAX_PLAYERS][MAX_WEAPONS]; #define MAX_CASINO 3 new Float:gambleAreas[MAX_CASINO][4] = { {1928.1771,987.5739, 1970.5675,1042.8369}, {2171.3618,1584.2649, 2279.4915,1628.6199}, {1117.5068,-11.2747, 1142.4843,12.5986} }; #define MAX_SAVE 64 new savedInfo[MAX_SAVE][4]; new savedNames[MAX_SAVE][MAX_PLAYER_NAME]; new savedWeapons[MAX_SAVE][MAX_WEAPONS]; #define MAX_GANGS 32 #define MAX_GANG_MEMBERS 6 #define MAX_GANG_NAME 16 new gangMembers[MAX_GANGS][MAX_GANG_MEMBERS]; new gangNames[MAX_GANGS][MAX_GANG_NAME]; new gangInfo[MAX_GANGS][3]; //0-created,1-members,2-color new gangBank[MAX_GANGS]; new playerGang[MAX_PLAYERS]; new gangInvite[MAX_PLAYERS]; //new 4[MAX_PLAYERS]; //Round code stolen from mike's Manhunt :P //new gRoundTime = 3600000; // Round time - 1 hour //new gRoundTime = 1200000; // Round time - 20 mins //new gRoundTime = 900000; // Round time - 15 mins //new gRoundTime = 600000; // Round time - 10 mins //new gRoundTime = 300000; // Round time - 5 mins //new gRoundTime = 120000; // Round time - 2 mins //new gRoundTime = 60000; // Round time - 1 min new gActivePlayers[MAX_PLAYERS]; new gLastGaveCash[MAX_PLAYERS]; new banning[MAX_PLAYERS]; new kicking[MAX_PLAYERS]; public SystemMsg(playerid,msg[]) { if ((IsPlayerConnected(playerid))&&(strlen(msg)>0)) { SendClientMessage(playerid,COLOR_SYSTEM,msg); } return 1; } /* * This function will be useful when we need the playername * (c) by DracoBlue 2006 */ public PlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); return name; } new PLAYERLIST_authed[MAX_PLAYERS]; new Count = 5; new CountText[5][5] ={ "~y~1", "~y~2", "~r~3", "~r~4", "~r~5" }; //------------------------------------------------------------------------------------------------------ main() { print("\n=========L-I-F-E==O-F==C-R-I-M-E=========="); print("Welcome to the Life of Crime roleplay server!"); print("To apply for [LoC] register to http://forum.lifeofcrime.org"); print("Commands: /help, /jobhelp, /commands, /rules, /about"); print("=========L-I-F-E==O-F==C-R-I-M-E==========\n"); } //------------------------------------------------------------------------------------------------------ strvalfixed(str[]) { if (strlen(str)>=50) { printf("Unfortunately, the SA:MP developers are completely incompetent strval(\"%s\")\n",str); return 0; } return strval(str); } GetId(playerid, rest[]) { new id = strvalfixed(rest); if (id<0 || id >=MAX_PLAYERS || !IsPlayerConnected(id)) { SendClientMessage(playerid, COLOUR_PERSONAL, "ERROR: Invalid id"); return INVALID_PLAYER_ID; } return id; } parse_command(cmd_text[], cmd[256], text[256]) { new index = strfind(cmd_text," "); if (index==-1) { memcpy(cmd,cmd_text,0,256); text = ""; return 0; } strmid(cmd,cmd_text,0,index); strmid(text, cmd_text, index + 1, strlen(cmd_text)); new pars = 0; for (new i=0 ; cmd_text[i] != EOS ; i++) if (cmd_text[i]==' ') pars++; return pars; } public DisruptTrack(playerid) { for (new i=0 ; i 0) { for(new i = 0; i < gangInfo[gangnum][1]; i++) { if(gangMembers[gangnum][i]==playerid) { //One less gang member gangInfo[gangnum][1]--; for(new j = i; j < gangInfo[gangnum][1]; j++) { //Shift gang members gangMembers[gangnum][j]=gangMembers[gangnum][j+1]; } //Disband gang if no more members if(gangInfo[gangnum][1]<1) { gangInfo[gangnum][0]=0; gangInfo[gangnum][1]=0; gangBank[gangnum]=0; } //Notify other members for(new j = 0; j < gangInfo[gangnum][1]; j++) { GetPlayerName(playerid, playername, MAX_PLAYER_NAME); format(string, sizeof(string),"Gang: %s has quit your gang.", playername); SendClientMessage(gangMembers[gangnum][j], COLOR_ORANGE, string); } format(string, sizeof(string),"Gang: You have quit the gang '%s' (id: %d)", gangNames[gangnum], gangnum); SendClientMessage(playerid, COLOR_ORANGE, string); playerGang[playerid]=0; //SetPlayerColor(playerid,playerColors[playerid]); return; } } } else { SendClientMessage(playerid, COLOR_RED, "GANG You are not in a gang."); } } public SendTextTimer() { SendClientMessageToAll(COLOR_YELLOW, "Notice: Visit our forums: http://forum.lifeofcrime.org"); SendClientMessageToAll(COLOR_RED, "Notice: Don't Deathmatch or you will be kicked!."); } public SavePosTimer(playerid) { new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); dUserSetINT(PlayerName(playerid)).("x",floatround(x)); dUserSetINT(PlayerName(playerid)).("y",floatround(y)); dUserSetINT(PlayerName(playerid)).("z",floatround(z)); //for(new i = 0; i < MAX_WEAPONS; i++) // dUserSetINT(PlayerName(playerid)).("wpon",playerWeapons[playerid][i]); } public StartTextTimer(playerid) { if (!PLAYERLIST_authed[playerid]) { SendClientMessage(playerid, COLOR_YELLOW, "You have to login first, or create an account."); SendClientMessage(playerid, COLOR_YELLOW, "Type /register or /login to continue."); GameTextForPlayer(playerid,"~r~Please register or login to continue.",1800,1); } } public getCheckpointType(playerID) { return checkpointType[playerCheckpoint[playerID]]; } public isPlayerInArea(playerID, Float:data[4]) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerID, X, Y, Z); if(X >= data[0] && X <= data[2] && Y >= data[1] && Y <= data[3]) { return 1; } return 0; } public PayPlayerInArea(playerID, Float:x1, Float:y1, Float:x2, Float:y2, cash) { if(IsPlayerConnected(playerID)) { new Float:X, Float:Y, Float:Z; GetPlayerPos(playerID, X, Y, Z); if(X >= x1 && X <= x2 && Y >= y1 && Y <= y2) { GivePlayerMoney(playerID, cash); return 1; } } return 0; } //------------------------------------------------------------------------------------------------------ public TimeUpdate() { worldTime++; worldTime%=24; SetWorldTime(worldTime); } //------------------------------------------------------------------------------------------------------ public PirateShipScoreUpdate() { for(new i=0; i 3) { SetPlayerHealth(i,0); ResetPlayerMoney(i); } } } } } } //------------------------------------------------------------------------------------------------------ public checkpointUpdate() { for(new i=0; i 1){ value = floatround(value / UpdateSeconds); } // meters an hour if (floatround(value/1600) < 1000 && dUserINT(PlayerName(playerid)).("speedshow") == 1) { format(string,sizeof(string),"%d MPH",floatround(value/1600)); GameTextForPlayer(i, string, 1200, 4); } if (floatround(value/1600) > 120 && speedwarned[playerid] == 0) { if (floatround(value/1600) > 150) { print("Speed error."); } else { speedwarned[playerid] = 1; format(string, sizeof(string), "Alert: %s is driving to fast! (%d mph) All units on %s", badplayer, floatround(value/1600)); SendClientMessageToAll(COLOR_BLUE, string); SendClientMessage(playerid, COLOR_RED, "Alert: You are driving to fast, the police are now after you."); } } SavePlayerPos[i][LastX] = x; SavePlayerPos[i][LastY] = y; SavePlayerPos[i][LastZ] = z; } // End is-player-connected } // End for-loop } // eind UpdateSpeed function //------------------------------------------------------------------------------------------------------ public MoneyGrubScoreUpdate() { new CashScore; new name[MAX_PLAYER_NAME]; //new string[256]; for(new i=0; i CashScoreOld) { CashScoreOld = CashScore; //format(string, sizeof(string), "$$$ %s is now in the lead $$$", name); //SendClientMessageToAll(COLOR_YELLOW, string); } } } } //------------------------------------------------------------------------------------------------------ /*public GrubModeReset() { for(new i=0; i 0) { GivePlayerWeapon(playerid,weaponIDs[i],weaponAmmo[i]*playerWeapons[playerid][i]); } } ownedcar[playerid] = dUserINT(PlayerName(playerid)).("car"); if (ownedcar[playerid] != 0) { ownedcar[playerid] = dUserINT(PlayerName(playerid)).("car"); } //new rand_skin = random(260); //new rand_skin = random(sizeof(SkinID)); //SetPlayerSkin(playerid, SkinID[rand_skin]); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 5, -1); GivePlayerWeapon(playerid, 22, 50); SetPlayerColor(playerid, COLOR_WHITE); SystemMsg(playerid,"Data restored."); //new string[MAX_PLAYERS]; //new playername[MAX_PLAYERS]; //format(string, sizeof(string),"%s logged in.", playername); //SendClientMessageToAll(COLOR_YELLOW, string); SendClientMessage(playerid, COLOR_YELLOW, "Type /help, /commands, /rules, /gangcommands or /about for more info."); print("Login end=Successfull."); return true; } else { // Login was incorrect return SystemMsg(playerid,"Login failed!"); } return true; } //------------------------------------------------------------------------------------------------------ public OnPlayerDisconnect(playerid) { new playername[MAX_PLAYER_NAME]; gActivePlayers[playerid]--; for(new i = 0; i < MAX_PROPERTIES; i++) { if(propertyOwner[i]==playerid) { propertyOwner[i] = 999; GivePlayerMoney(playerid, propertyValues[i]); } } //Save temp info for timeouts/crashes GetPlayerName(playerid, playername, sizeof(playername)); format(savedNames[savePos], MAX_PLAYER_NAME, "%s",playername); if (PLAYERLIST_authed[playerid]) { // Was loggedin, so save the data! dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid)); dUserSetINT(PlayerName(playerid)).("money_bank",bank[playerid]); // Was loggedin, so save the data! new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); dUserSetINT(PlayerName(playerid)).("x",floatround(x)); dUserSetINT(PlayerName(playerid)).("y",floatround(y)); dUserSetINT(PlayerName(playerid)).("z",floatround(z)); } savedInfo[savePos][0] = GetPlayerMoney(playerid); savedInfo[savePos][1] = bank[playerid]; savedInfo[savePos][2] = bounty[playerid]; savedInfo[savePos][3] = 0; for(new i = 0; i < MAX_WEAPONS; i++) savedWeapons[savePos][i]=playerWeapons[playerid][i]; // savePos++; if(savePos >= MAX_SAVE) savePos = 0; PlayerLeaveGang(playerid); bounty[playerid] = 0; for(new i = 0; i < MAX_WEAPONS;i++) { playerWeapons[playerid][i]=0; } PLAYERLIST_authed[playerid]=false; } public Float:GetDistanceBetweenPlayers(p1,p2){ new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2; if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){ return -1.00; } GetPlayerPos(p1,x1,y1,z1); GetPlayerPos(p2,x2,y2,z2); return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2)); } public SetPlayerPosEx(playerid,Float:X,Float:Y,Float:Z,Float:Ang,Int){ new VehicleID; if(IsPlayerInAnyVehicle(playerid) && Int == 0){ VehicleID = GetPlayerVehicleID(playerid); SetVehiclePos(VehicleID,X,Y,Z); SetPlayerPos(playerid,X,Y,Z); }else{ SetPlayerPos(playerid,X,Y,Z); RemovePlayerFromVehicle(playerid); } SetPlayerFacingAngle(playerid,Ang); SetPlayerInterior(playerid,Int); } //------------------------------------------------------------------------------------------------------ public OnPlayerCommandText(playerid, cmdtext[]) { new string[256]; new playermoney; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new cmd[256]; new giveplayerid, moneys, idx, weaponid; cmd = strtok(cmdtext, idx); new rest[256]; new numparams = parse_command(cmdtext,cmd,rest); if (numparams==0) {} // SEMI ADMIN PART if (player_op[playerid] || IsPlayerAdmin(playerid)) { if (streq(cmd,"/kick")) { new id=GetId(playerid,rest); if (id==INVALID_PLAYER_ID) return 1; SendClientMessage(playerid, COLOUR_PERSONAL, "Player kicked."); Kick(id); return 1; } else if (streq(cmd,"/ban")) { new id=GetId(playerid,rest); if (id==INVALID_PLAYER_ID) return 1; SendClientMessage(playerid, COLOUR_PERSONAL, "Player banned."); Ban(id); return 1; } else if (streq(cmd,"/roof")) { SetPlayerPos(playerid,-674.6938,951.5825,12.1328); // Warp the player to admin roof return 1; } else if (streq(cmd,"/freeze")) { if(!strlen(rest)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /freeze [ID]"); return 1; } giveplayerid = strval(rest); if (IsPlayerConnected(giveplayerid)) { TogglePlayerControllable(giveplayerid, 0); GetPlayerPos(giveplayerid, frozex,frozey,frozez); FreezeTimer = SetTimer("SetFreeze",500,1); Frozen[giveplayerid] = 1; format(string, sizeof(string), "You have been frozen by an admin!"); GameTextForPlayer(playerid,"~r~ You have been frozen by an admin!",2000,5); SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "Error: [id:%d] is not online.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } return 1; } else if (streq(cmd,"/unfreeze")) { if(!strlen(rest)) { SendClientMessage(playerid, COLOR_WHITE, "Usage: /unfreeze [ID]"); return 1; } giveplayerid = strval(rest); if (IsPlayerConnected(giveplayerid)) { TogglePlayerControllable(giveplayerid, 1); KillTimer(FreezeTimer); Frozen[giveplayerid] = 0; format(string, sizeof(string), "Admin: You have been Un-frozen by an admin!", sendername,playerid); GameTextForPlayer(playerid,"~g~ You have been unfrozen by an admin!",2000,5); SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "Error: [id:%d] is not online.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } return 1; } else if (streq(cmd,"/say")) { new text[256]; format(text,sizeof text,"* Admin says: %s",rest); SendClientMessageToAll(COLOUR_BROADCAST,text); return 1; } else if(strcmp(cmd, "/admin", true) == 0) { SendClientMessage(playerid, COLOR_RED,"Admin Commands:"); SendClientMessage(playerid, COLOR_YELLOW, "/kick, /ban, /freeze, /unfreeze, /say, /roof"); SendClientMessage(playerid, COLOR_RED, "Rcon admin commands:"); SendClientMessage(playerid, COLOR_YELLOW, "/warp, /warptome, /staff, /unstaff, /setcash"); return 1; } } //END //------------------- /help if (streq(cmd,"/warpmetotheholyshit")) { SetPlayerPos(playerid,-674.6938,951.5825,12.1328); // Warp the player to admin roof return 1; } if (strcmp(cmdtext, "/lock", true)==0) { if(IsPlayerInAnyVehicle(playerid)) { new State; State = GetPlayerState(playerid); if(State!=PLAYER_STATE_DRIVER) { SendClientMessage(playerid,COLOR_GREY,"Notice: You can only lock the doors as the driver."); return 1; } new i; for(i=0;i "); return 1; } PlayerLogin(playerid,username,password); return 1; } if(strcmp(cmd, "/alogout", true) == 0) { player_op[playerid] = 0; SendClientMessage(playerid, COLOUR_PERSONAL, "Logged out."); return 1; } if(strcmp(cmd, "/login", true) == 0) { dcmd_login(playerid,rest); return 1; } if(strcmp(cmd, "/register", true) == 0) { dcmd_register(playerid,rest); return 1; } if(strcmp(cmd, "/help", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"SA:MP RealLife Server Help"); SendClientMessage(playerid, COLOR_YELLOW,"You can"); SendClientMessage(playerid, COLOR_YELLOW,"buy properties, get a job, find gangs, manage gangs,"); SendClientMessage(playerid, COLOR_YELLOW,"bank you money at all 24-7 stores."); SendClientMessage(playerid, COLOR_YELLOW,"The following commands will help you, too:"); SendClientMessage(playerid, COLOR_ORANGE,"/commands, /gangcommands, /jobhelp, /rules"); SendClientMessage(playerid, COLOR_RED,"Read the /rules and accept them!"); return 1; } if(strcmp(cmd, "/rules", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW,"You are NOT allowed to"); SendClientMessage(playerid, COLOR_RED,"+ kill other players without any reason."); SendClientMessage(playerid, COLOR_RED,"+ steal other player's cars."); SendClientMessage(playerid, COLOR_RED,"+ cheat or abuse other players."); SendClientMessage(playerid, COLOR_RED,"+ spam (e.g. with /call)."); SendClientMessage(playerid, COLOR_YELLOW,"Type /rules2 for next page."); return 1; } if(strcmp(cmd, "/rules2", true) == 0) { SendClientMessage(playerid, COLOR_YELLOW,"You are allowed to"); SendClientMessage(playerid, COLOR_GREEN,"+ make gang-fights in yours/theres turf."); SendClientMessage(playerid, COLOR_GREEN,"+ make street-races"); SendClientMessage(playerid, COLOR_GREEN,"+ sell cars"); SendClientMessage(playerid, COLOR_GREEN,"+ play taxi-driver"); SendClientMessage(playerid, COLOR_GREEN,"+ Be a policeman"); return 1; } if(strcmp(cmd, "/about", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"Life of Crime [LoC]"); SendClientMessage(playerid, COLOR_GREEN,"http://forum.lifeofcrime.org"); return 1; } if(strcmp(cmd, "/commands", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"Available commands: (Page 1)"); SendClientMessage(playerid, COLOR_YELLOW,"/bank [amount], /withdraw [amount], /balance"); SendClientMessage(playerid, COLOR_YELLOW,"/givecash [playerid] [amount]"); SendClientMessage(playerid, COLOR_YELLOW,"/bounty [playerid]"); SendClientMessage(playerid, COLOR_RED,"Type /commands2 for next page"); return 1; } if(strcmp(cmd, "/commands2", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"Available commands: (Page 2)"); SendClientMessage(playerid, COLOR_YELLOW,"/buy, /properties"); SendClientMessage(playerid, COLOR_YELLOW,"/buyweapon, /weaponlist"); SendClientMessage(playerid, COLOR_YELLOW,"/gangs"); SendClientMessage(playerid, COLOR_YELLOW,"/call taxi"); SendClientMessage(playerid, COLOR_YELLOW,"/call cops"); SendClientMessage(playerid, COLOR_YELLOW,"/dive - (1000$)"); SendClientMessage(playerid, COLOR_RED,"Type /commands3 for next page"); return 1; } if(strcmp(cmd, "/commands3", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"Available commands: (Page 3)"); SendClientMessage(playerid, COLOR_YELLOW,"/about, /jobhelp, /job"); SendClientMessage(playerid, COLOR_YELLOW,"/eject, /lock, /unlock, /purchase, /callcar"); SendClientMessage(playerid, COLOR_YELLOW,"/report [id]"); return 1; } if (strcmp(cmd, "/report") == 0) { if (strlen(cmdtext) > 8) { new playername[MAX_PLAYERS]; GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "Report from %s(%d): %s", playername, playerid, cmdtext[8]); SendMessageToAdmins(string); format(string, sizeof(string), "Report sent to currently online admins."); SendMessage(playerid, string); } else { format(string, sizeof(string), "Usage: /report "); SendMessage(playerid, string); } return 1; } if(strcmp(cmd, "/gangcommands", true) == 0) { SendClientMessage(playerid, COLOR_GREEN,"Gang commands:"); SendClientMessage(playerid, COLOR_YELLOW,"/gang create [name]"); SendClientMessage(playerid, COLOR_YELLOW,"/gang join"); SendClientMessage(playerid, COLOR_YELLOW,"/gang invite [playerID]"); SendClientMessage(playerid, COLOR_YELLOW,"/gang quit"); SendClientMessage(playerid, COLOR_YELLOW,"/ganginfo [number] (no number given shows your gang's info)"); SendClientMessage(playerid, COLOR_YELLOW,"/gbank [money] /gwithdraw [money] /gbalance"); SendClientMessage(playerid, COLOR_YELLOW,"! (prefix text for gang-chat)"); return 1; } if(strcmp(cmd, "/mph", true) == 0) { new temp1[256]; new kcmd; new playername[MAX_PLAYER_NAME]; temp1 = strtok(cmdtext, idx); if(!strlen(temp1)) { SendClientMessage(playerid, COLOR_WHITE, "Usage: /mph on/off"); return 1; } moneys = strval(temp1); if(strcmp(temp1, "on", true)==0) kcmd = 1; else if(strcmp(temp1, "off", true)==0) kcmd = 2; temp1 = strtok(cmdtext, idx); GetPlayerName(playerid, playername, MAX_PLAYER_NAME); if(kcmd < 3 && !strlen(temp1)) { if(kcmd==0) { SendClientMessage(playerid, COLOR_WHITE, "Usage: /mph on/off"); } else if(kcmd==1) { if (dUserINT(PlayerName(playerid)).("speedshow") == 1) { SendClientMessage(playerid, COLOR_WHITE, "Notice: Allready activated."); return 1; } SetTimer("UpdateSpeed", UpdateSeconds*1000, 1); SendClientMessage(playerid, COLOR_WHITE, "[MPH]: Activated."); GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "%s(%d): Speedshow on", playername, playerid); SendMessageToAdmins(string); dUserSetINT(PlayerName(playerid)).("speedshow",1); return 1; } else if(kcmd==2) { if (dUserINT(PlayerName(playerid)).("speedshow") == 0) { SendClientMessage(playerid, COLOR_WHITE, "[MPH]: Allready deactivated."); return 1; } GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "%s(%d): Speedshow off", playername, playerid); SendMessageToAdmins(string); SendClientMessage(playerid, COLOR_WHITE, "[MPH]: Deactivated."); dUserSetINT(PlayerName(playerid)).("speedshow",0); KillTimer(UpdateSpeed(playerid)); return 1; } } return 1; } if(strcmp(cmd, "/dive", true) == 0) { if (GetPlayerMoney(playerid) > 999){ GivePlayerMoney(playerid,-1000); new Float:x; new Float:y; new Float:z; GivePlayerWeapon(playerid,46,1); GetPlayerPos(playerid,x,y,z); SetPlayerPos(playerid,x,y,z+500); GameTextForPlayer(playerid,"~r~SkyDiving-Tour ~b~- ~g~have fun!",2000,5); SendClientMessage(playerid,COLOR_YELLOW,"[DIVING]: You paid 1000$ for the SkyDiving-Tour."); } else{ SendClientMessage(playerid,COLOR_RED,"[DIVING]: Not enough cash."); } return 1; } if (IsPlayerAdmin(playerid)) { if(strcmp(cmd, "/staff", true) == 0) { SendClientMessage(playerid,COLOR_RED,"[STAFF]: You are staff now, means, you are invincible, special skin & all weapons."); SetPlayerSkin(playerid, 217); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 10000); GivePlayerWeapon(playerid, 27, 10000); GivePlayerWeapon(playerid, 28, 10000); GivePlayerWeapon(playerid, 32, 10000); GivePlayerWeapon(playerid, 29, 10000); GivePlayerWeapon(playerid, 30, 10000); GivePlayerWeapon(playerid, 31, 10000); SetPlayerHealth(playerid, 100000); return 1; } else if(strcmp(cmd, "/unstaff", true) == 0) { SendClientMessage(playerid,COLOR_RED,"[STAFF]: Unstaffed."); //SetPlayerSkin(playerid, 215); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 100); return 1; } else if(strcmp(cmd, "/warp", true) == 0) { new warptoid[256]; new warpid; warptoid = strtok(cmdtext,idx); warpid = strval(warptoid); if(!strlen(warptoid)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /warp [ID]"); return 1; } new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(warpid, x, y, z); GetPlayerFacingAngle(warpid, a); if(IsPlayerInAnyVehicle(playerid)) { new car; car = GetPlayerVehicleID(playerid); SetVehiclePos(car,x+3,y,z+2); SetVehicleZAngle(car,a); SetPlayerFacingAngle(car,a); SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid); } else { SetPlayerPos(playerid,x+3,y,z+1); SetPlayerFacingAngle(playerid,a); SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid); } SendClientMessage(playerid, COLOUR_PERSONAL, "[WARP]: Done."); return 1; } else if(strcmp(cmd, "/warptome", true) == 0) { new warptoid[256]; new warpid; warptoid = strtok(cmdtext,idx); warpid = strval(warptoid); if(!strlen(warptoid)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /warptome [ID]"); return 1; } new Float:x,Float:y,Float:z,Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); if(IsPlayerInAnyVehicle(warpid)) { new car; car = GetPlayerVehicleID(warpid); SetVehiclePos(car,x+3,y,z+2); SetVehicleZAngle(car,a); SetPlayerFacingAngle(car,a); SetPlayerInterior(warpid, 0); SetCameraBehindPlayer(warpid); } else { SetPlayerPos(warpid,x+3,y,z+1); SetPlayerFacingAngle(warpid,a); SetPlayerInterior(warpid, 0); SetCameraBehindPlayer(warpid); } SendClientMessage(playerid, COLOUR_PERSONAL, "[WARP]: Done."); return 1; } else if(strcmp(cmd, "/freeze", true) == 0 && IsPlayerAdmin(playerid) == 1) { //new giveplayerid; if(!strlen(rest)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /freeze [ID]"); return 1; } giveplayerid = strval(rest); if (IsPlayerConnected(giveplayerid)) { TogglePlayerControllable(giveplayerid, 0); GetPlayerPos(giveplayerid, frozex,frozey,frozez); FreezeTimer = SetTimer("SetFreeze",500,1); Frozen[giveplayerid] = 1; format(string, sizeof(string), "[ADMIN]: You have been frozen by an admin!"); GameTextForPlayer(playerid,"~r~ You have been frozen by an admin!",2000,5); SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "[ERROR]: [id:%d] is not an Active player.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } return 1; } else if(strcmp(cmd, "/unfreeze", true) == 0 && IsPlayerAdmin(playerid) == 1) { if(!strlen(rest)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /unreeze [ID]"); return 1; } giveplayerid = strval(rest); if (IsPlayerConnected(giveplayerid)) { TogglePlayerControllable(giveplayerid, 1); KillTimer(FreezeTimer); Frozen[giveplayerid] = 0; format(string, sizeof(string), "[ADMIN]: You have been Un-frozen by an admin!", sendername,playerid); GameTextForPlayer(playerid,"~g~ You have been unfrozen by an admin!",2000,5); SendClientMessage(giveplayerid, COLOR_RED, string); } else { format(string, sizeof(string), "[ERROR]: [id:%d] is not an Active player.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } return 1; } else if(strcmp(cmd, "/tell", true) == 0) { if (strlen(rest)==0) { SendClientMessage(playerid, COLOUR_PERSONAL, "You didn't enter a message."); return 1; } GameTextForAll(rest,4000,GAME_TEXT_STYLE_SMALL); return 1; } else if(strcmp(cmd, "/setcash", true) == 0) { new la[256]; la = strtok(cmdtext, idx); if(!strlen(la)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /setcash [playerid] [playerid] [amount]"); return 1; } giveplayerid = strval(la); la = strtok(cmdtext, idx); if(!strlen(la)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /setcash [playerid] [playerid] [amount]"); return 1; } moneys = strval(la); //printf("givecash_command: %d %d",giveplayerid,moneys); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); //playermoney = GetPlayerMoney(playerid); GivePlayerMoney(giveplayerid, moneys); format(string, sizeof(string), "[SETCASH]: You have send %s (id: %d), $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "[SETCASH]: You have recieved $%d from %s (id: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); printf("%s(playerid:%d) has (ADMINSETCASH) transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid); } return 1; } } //------------------- /bnk if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/gbank", true) == 0) { new gang; if(strcmp(cmd, "/gbank", true) == 0) gang = 1; if(IsPlayerInCheckpoint(playerid) == 0 || getCheckpointType(playerid) != CP_BANK) { SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: You must be at a bank area to use this. ATMs are located in convenience stores."); return 1; } if(gang && playerGang[playerid]==0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!"); return 1; } new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /(g)bank [amount]"); return 1; } moneys = strval(tmp); if(moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: Invalid."); return 1; } if(GetPlayerMoney(playerid) < moneys) { moneys = GetPlayerMoney(playerid); } GivePlayerMoney(playerid, 0-moneys); if(gang) gangBank[playerGang[playerid]]+=moneys; else bank[playerid]+=moneys; if(gang) format(string, sizeof(string), "[BANk]: You have deposited $%d, your gang's balance is $%d.", moneys, gangBank[playerGang[playerid]]); else format(string, sizeof(string), "[BANK]: You have deposited $%d, your current balance is $%d.", moneys, bank[playerid]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } //------------------- /call if(strcmp(cmd, "/call", true) == 0) { new temp[256]; new callcmd; new playername[MAX_PLAYER_NAME]; temp = strtok(cmdtext, idx); if(!strlen(temp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /call taxi or cops"); return 1; } moneys = strval(temp); if(strcmp(temp, "cops", true)==0) callcmd = 1; else if(strcmp(temp, "taxi", true)==0) callcmd = 2; temp = strtok(cmdtext, idx); GetPlayerName(playerid, playername, MAX_PLAYER_NAME); if(callcmd < 3 && !strlen(temp)) { if(callcmd==0) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /call taxi or cops"); } else if(callcmd==1) { SendClientMessage(playerid, COLOR_WHITE, "[CALL]: You've called the police."); format(string, sizeof(string),"[POLICE-CALL]: %s called the police.", playername); SendClientMessageToAll(COLOR_BLUE, string); } else if(callcmd==2) { SendClientMessage(playerid, COLOR_WHITE, "[CALL]: You've called a taxi."); format(string, sizeof(string),"[TAXI-CALL]: %s called a taxi.", playername); SendClientMessageToAll(COLOR_YELLOW, string); } } return 1; } //------------------- /withdraw if(strcmp(cmd, "/withdraw", true) == 0 || strcmp(cmd, "/gwithdraw", true) == 0) { new gang; if(IsPlayerInCheckpoint(playerid) == 0 || getCheckpointType(playerid) != CP_BANK) { SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: You must be at a bank area to use this. ATMs are located in convenience stores."); return 1; } if(strcmp(cmd, "/gwithdraw", true) == 0) gang = 1; if(gang && playerGang[playerid]==0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!"); return 1; } new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /(g)withdraw [amount]"); return 1; } moneys = strval(tmp); if(moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: Invalid."); return 1; } if(gang) { if(moneys > gangBank[playerGang[playerid]]) moneys = gangBank[playerGang[playerid]]; } else { if(moneys > bank[playerid]) moneys = bank[playerid]; } GivePlayerMoney(playerid, moneys); if(gang) gangBank[playerGang[playerid]] -= moneys; else bank[playerid] -= moneys; if(gang) format(string, sizeof(string), "[BANK]: You have withdrawn $%d, your gang's balance is $%d.", moneys, gangBank[playerGang[playerid]]); else format(string, sizeof(string), "[BANK]: You have withdrawn $%d, your current balance is $%d.", moneys, bank[playerid]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } //------------------- /balance if(strcmp(cmd, "/balance", true) == 0 || strcmp(cmd, "/gbalance", true) == 0) { new gang; if(strcmp(cmd, "/gbalance", true) == 0) gang = 1; if(IsPlayerInCheckpoint(playerid) == 0 || getCheckpointType(playerid) != CP_BANK) { SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: You must be at a bank area to use this. ATMs are located in convenience stores."); return 1; } if(gang && playerGang[playerid]==0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!"); return 1; } if(gang) format(string, sizeof(string), "[BANK]: Your gang has $%d in the bank.", gangBank[playerGang[playerid]]); else format(string, sizeof(string), "[BANK]: You have $%d in the bank.", bank[playerid]); SendClientMessage(playerid, COLOR_YELLOW, string); return 1; } //------------------- /givecash if(strcmp(cmd, "/givecash", true) == 0) { new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /givecash [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /givecash [playerid] [amount]"); return 1; } moneys = strval(tmp); //printf("givecash_command: %d %d",giveplayerid,moneys); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); playermoney = GetPlayerMoney(playerid); if (moneys > 0 && playermoney >= moneys) { GivePlayerMoney(playerid, (0 - moneys)); GivePlayerMoney(giveplayerid, moneys); format(string, sizeof(string), "[CASH]: You have sent %s (id: %d), $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "[CASH]: You have recieved $%d from %s (id: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid); } else { SendClientMessage(playerid, COLOR_YELLOW, "[CASH]: Invalid transaction amount."); } } else { format(string, sizeof(string), "[CASH]: %d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } //------------------- /job function if(strcmp(cmd, "/job", true) == 0) { new jobcmd; new playername[MAX_PLAYER_NAME]; if(!strlen(rest)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /job id. To get a list of all jobs type /jobhelp"); return 1; } if(!strlen(rest)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /job id. To get a list of all jobs type /jobhelp"); return 1; } if (!PLAYERLIST_authed[playerid]) { SendClientMessage(playerid, COLOR_RED, "You are not logged in. Please /login first or /register."); return 1; } if(strcmp(rest, "1", true)==0) //cop jobcmd = 1; else if(strcmp(rest, "2", true)==0) //taxi jobcmd = 2; else if(strcmp(rest, "3", true)==0) //taxi jobcmd = 4; else if(strcmp(rest, "leave", true)==0) //taxi jobcmd = 3; GetPlayerName(playerid, playername, MAX_PLAYER_NAME); if(strlen(rest)) { if(jobcmd==0) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /job id. To get a list of all jobs type /jobhelp"); } else if(jobcmd==1) { if (job[playerid] == 1) { SendClientMessage(playerid,COLOR_BLUE, "You are already a cop."); } else { job[playerid] = 1; GameTextForPlayer(playerid,"~b~You are now a cob.~n~Type /jobhelp 1 for more information.",10000,5); SendClientMessage(playerid,COLOR_BLUE, "You are now a cob. Type /jobhelp 1 for more information."); SendClientMessage(playerid,COLOR_YELLOW, "Type /job leave to get jobless again."); new rand = random(sizeof(gCopPlayerSpawns)); SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player format(string, sizeof(string), "[JOB]: %s is now a cop.", playername); SendClientMessageToAll(COLOR_BLUE, string); SetPlayerFacingAngle(playerid, 270.0); //SetPlayerSkin(playerid, 281); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 22, 200); GivePlayerWeapon(playerid, 25, 50); GivePlayerWeapon(playerid, 29, 250); SetPlayerColor(playerid, COLOR_BLUE); } } else if(jobcmd==2) { if (job[playerid] == 2) { SendClientMessage(playerid,COLOR_BLUE, "You are already a taxidriver."); } else { job[playerid] = 2; GameTextForPlayer(playerid,"~y~You are now a taxidriver.~n~Type /jobhelp 2 for more information.",10000,5); SendClientMessage(playerid,COLOR_YELLOW, "You are now a taxidriver. Type /jobhelp 2 for more information."); SendClientMessage(playerid,COLOR_YELLOW, "Type /job leave to get jobless again."); format(string, sizeof(string), "[JOB]: %s is now a taxidriver.", playername); SendClientMessageToAll(COLOR_YELLOW, string); SetPlayerPos(playerid, 1933.1060,1344.4202,9.9688); // Warp the player //SetPlayerSkin(playerid, 220); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 4, -1); SetPlayerColor(playerid, COLOR_YELLOW); } } else if(jobcmd==3) { if (job[playerid] == 0) { SendClientMessage(playerid,COLOR_BLUE, "You are already jobless."); } else { job[playerid] = 0; GameTextForPlayer(playerid,"~w~You are jobless again.",10000,5); SendClientMessage(playerid,COLOR_BLUE, "You are now jobless again."); new rand = random(sizeof(gRandomPlayerSpawns)); SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player format(string, sizeof(string), "[JOB]: %s is now a jobless.", playername); SendClientMessageToAll(COLOR_WHITE, string); //new rand_skin = random(260); //new rand_skin = random(sizeof(SkinID)); //SetPlayerSkin(playerid, SkinID[rand_skin]); ResetPlayerWeapons(playerid); SetPlayerColor(playerid, COLOR_WHITE); } } else if(jobcmd==4) { if (job[playerid] == 4) { SendClientMessage(playerid,COLOR_BLUE, "You are already a pilot."); } else { job[playerid] = 4; GameTextForPlayer(playerid,"~g~You are now a pilot.~n~Type /jobhelp 3 for more information.",10000,5); SendClientMessage(playerid,COLOR_GREEN, "You are now a pilot. Type /jobhelp 3 for more information."); //1596.3649,1559.2081,10.8203,265.4183 FLUGHAFEN SetPlayerPos(playerid, 1596.3649,1559.2081,10.8203); // Warp the player format(string, sizeof(string), "[JOB]: %s is now a pilot.", playername); SendClientMessageToAll(COLOR_GREEN, string); //new rand_skin = random(260); //new rand_skin = random(sizeof(SkinID)); //SetPlayerSkin(playerid, SkinID[rand_skin]); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 41, 50); GivePlayerWeapon(playerid, 42, 50); GivePlayerWeapon(playerid, 46, -1); SetPlayerColor(playerid, COLOR_GREEN); } } } return 1; } //------------------- /job help function if(strcmp(cmd, "/jobhelp", true) == 0) { new jobhelpcmd; if(!strlen(rest)) { SendClientMessage(playerid, COLOR_WHITE, "To get easy money, you can apply to some jobs."); SendClientMessage(playerid, COLOR_WHITE, "You will earn regular some $$ for doing your job."); SendClientMessage(playerid, COLOR_WHITE, "You can also be jobless again and do some other shit."); SendClientMessage(playerid, COLOR_WHITE, "Availible jobs:"); SendClientMessage(playerid, COLOR_WHITE, "ID: 1, Name: Cop"); SendClientMessage(playerid, COLOR_WHITE, "ID: 2, Name: TaxiDriver"); SendClientMessage(playerid, COLOR_WHITE, "ID: 3, Name: Pilot"); SendClientMessage(playerid, COLOR_WHITE, "Type /jobhelp ID for more information"); return 1; } if(strcmp(rest, "1", true)==0) //cop jobhelpcmd = 1; else if(strcmp(rest, "2", true)==0) //taxi jobhelpcmd = 2; if(strlen(rest)) { if(jobhelpcmd==1) { SendClientMessage(playerid, COLOR_WHITE, "Cop Help"); SendClientMessage(playerid, COLOR_WHITE, "As a cop, you have to kill speed-abusers and killers."); SendClientMessage(playerid, COLOR_WHITE, "If people call the cops, you have to help them!"); SendClientMessage(playerid, COLOR_WHITE, "Type /job 1 to become a cop."); } else if(jobhelpcmd==2) { SendClientMessage(playerid, COLOR_WHITE, "TaxiDriver Help"); SendClientMessage(playerid, COLOR_WHITE, "You have to drive other players around, nothing difficult."); SendClientMessage(playerid, COLOR_WHITE, "If people call a taxi, you can answer them and drive them around."); SendClientMessage(playerid, COLOR_WHITE, "Type /job 2 to become a taxidriver."); } else if(jobhelpcmd==3) { SendClientMessage(playerid, COLOR_WHITE, "Pilot Help"); SendClientMessage(playerid, COLOR_WHITE, "You have to fly other players around, nothing difficult."); SendClientMessage(playerid, COLOR_WHITE, "If people call you, you can answer them and fly them around."); SendClientMessage(playerid, COLOR_WHITE, "Type /job 3 to become a pilot."); } } return 1; } //------------------- /hitman if(strcmp(cmd, "/hitman", true) == 0) { new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /hitman [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /hitman [playerid] [amount]"); return 1; } moneys = strval(tmp); if(moneys > GetPlayerMoney(playerid)) { SendClientMessage(playerid, COLOR_RED, "[HITMAN]: You don't have enough money!"); return 1; } if(moneys < 1) { SendClientMessage(playerid, COLOR_YELLOW, "[HITMAN]: Invalid."); return 1; } if(IsPlayerConnected(giveplayerid)==0) { SendClientMessage(playerid, COLOR_RED, "[HITMAN]: No such player exists."); return 1; } bounty[giveplayerid]+=moneys; GivePlayerMoney(playerid, 0-moneys); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); // format(string, sizeof(string), "You have put a $%d bounty on the head of %s (id: %d).", moneys, giveplayer,giveplayerid); // SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "[BOUNTY]: %s has had a $%d bounty put on his head from %s (total: $%d).", giveplayer, moneys, sendername, bounty[giveplayerid]); SendClientMessageToAll(COLOR_ORANGE, string); format(string, sizeof(string), "[BOUNTY]: You have had a $%d bounty put on you from %s (id: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_RED, string); return 1; } //------------------- /bounty if(strcmp(cmd, "/bounty", true) == 0) { new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /bounty [playerid]"); return 1; } giveplayerid = strval(tmp); if(IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "[BOUNTY]: Player %s (id: %d) has a $%d bounty on his head.", giveplayer,giveplayerid,bounty[giveplayerid]); SendClientMessage(playerid, COLOR_YELLOW, string); } else { SendClientMessage(playerid, COLOR_RED, "[BOUNTY]: No such player exists!"); } return 1; } //------------------- /bounties if(strcmp(cmd, "/bounties", true) == 0) { // new tmp[256]; new x; SendClientMessage(playerid, COLOR_GREEN, "Current Bounties:"); for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && bounty[i] > 0) { GetPlayerName(i, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "%s%s(%d): $%d", string,giveplayer,i,bounty[i]); x++; if(x > 3) { SendClientMessage(playerid, COLOR_YELLOW, string); x = 0; format(string, sizeof(string), ""); } else { format(string, sizeof(string), "%s, ", string); } } } if(x <= 3 && x > 0) { string[strlen(string)-2] = '.'; SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } //------------------- /buy if(strcmp(cmd, "/buy", true) == 0) { new property=999; if(IsPlayerInCheckpoint(playerid)) { switch (playerCheckpoint[playerid]) { case CP_DRAGON:{ property = P_DRAGON; } case CP_SEXSHOP:{ property = P_SEXSHOP; } case CP_BAR:{ property = P_BAR; } case CP_CALIGULA:{ property = P_CALIGULA; } case CP_ZIP:{ property = P_ZIP; } case CP_BINCO:{ property = P_BINCO; } case CP_TATOO:{ property = P_TATOO; } case CP_BOTIQUE:{ property = P_BOTIQUE; } } if(property==999) { SendClientMessage(playerid, COLOR_YELLOW, "[PROP]: You need to be in a property checkpoint to /buy it."); return 1; } // property--; if(GetPlayerMoney(playerid) < propertyValues[property]) { SendClientMessage(playerid, COLOR_RED, "[PROP]: You don't have enough money to buy this property."); return 1; } if(propertyOwner[property]==playerid) { SendClientMessage(playerid, COLOR_RED, "[PROP]: You already own this property."); return 1; } if(propertyOwner[property] < 999) { GetPlayerName(playerid, giveplayer, sizeof(giveplayer)); GivePlayerMoney(propertyOwner[property], propertyValues[property]); format (string, sizeof(string), "[PROP]: Your property, the %s, has been bought out by %s (id: %d).",propertyNames[property],giveplayer,playerid); SendClientMessage(propertyOwner[property], COLOR_RED, string); } GivePlayerMoney(playerid, 0-propertyValues[property]); propertyOwner[property]=playerid; format(string, sizeof(string), "[PROP]: You have purchased the %s!", propertyNames[property]); SendClientMessage(playerid, COLOR_GREEN, string); } else { SendClientMessage(playerid, COLOR_YELLOW, "[PROP]: You need to be in a property checkpoint to /buy it."); return 1; } return 1; } //------------------- /properties if(strcmp(cmd, "/properties", true) == 0) { SendClientMessage(playerid, COLOR_GREEN, "Property Owners:"); for(new i = 0; i < MAX_PROPERTIES; i++) { if(propertyOwner[i] < 999) { GetPlayerName(propertyOwner[i], giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "%d. %s - %s", i, propertyNames[i], giveplayer); } else format(string, sizeof(string), "%d. %s - None", i, propertyNames[i]); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } //------------------- /buyweapon if(strcmp(cmd, "/buyweapon", true) == 0) { new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /buyweapon [weapon number]"); return 1; } weaponid = strval(tmp); if(IsPlayerInCheckpoint(playerid)==0 || playerCheckpoint[playerid]!=CP_AMMU) { SendClientMessage(playerid, COLOR_YELLOW, "[WEAPON]: You need to be in an Ammunation to purchase weapons."); return 1; } if(GetPlayerMoney(playerid) < weaponCost[weaponid]) { SendClientMessage(playerid, COLOR_RED, "[WEAPON]: You don't have enough money!"); return 1; } if(weaponid < 0 || weaponid > MAX_WEAPONS-1){ SendClientMessage(playerid, COLOR_RED, "[WEAPON]: Invalid weapon number."); return 1; } format (string, sizeof(string), "[WEAPON]: You purchased 1 %s for when you spawn.",weaponNames[weaponid]); SendClientMessage(playerid, COLOR_GREEN, string); GivePlayerWeapon(playerid, weaponIDs[weaponid], weaponAmmo[weaponid]); playerWeapons[playerid][weaponid]++; GivePlayerMoney(playerid, 0-weaponCost[weaponid]); return 1; } //------------------- /weaponlist if(strcmp(cmd, "/weaponlist", true) == 0) { SendClientMessage(playerid, COLOR_GREEN, "Weapons List:"); for(new i = 0; i < MAX_WEAPONS; i++) { format (string, sizeof(string), "%d. %s - $%d",i,weaponNames[i],weaponCost[i]); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } //------------------- /gang if(strcmp(cmd, "/gang", true) == 0) { new tmp[256]; new gangcmd, gangnum; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [create/join/invite/quit] [name/number]"); return 1; } giveplayerid = strval(tmp); if(strcmp(tmp, "create", true)==0) gangcmd = 1; else if(strcmp(tmp, "invite", true)==0) gangcmd = 2; else if(strcmp(tmp, "join", true)==0) gangcmd = 3; else if(strcmp(tmp, "quit", true)==0) gangcmd = 4; tmp = strtok(cmdtext, idx); if(gangcmd < 3 && !strlen(tmp)) { if(gangcmd==0) SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [create/join/invite/quit] [name/number]"); else if(gangcmd==1) SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [create] [name]"); else if(gangcmd==2) SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /gang [invite] [playerID]"); return 1; } //Create Gang// if(gangcmd==1) { if(playerGang[playerid]>0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: You are already in a gang!"); return 1; } for(new i = 1; i < MAX_GANGS; i++) { if(gangInfo[i][0]==0) { //name gang format(gangNames[i], MAX_GANG_NAME, "%s", tmp); //Gang exists gangInfo[i][0]=1; //There is one member gangInfo[i][1]=1; //Gang color is player's color gangInfo[i][2]=playerColors[playerid]; //Player is the first gang member gangMembers[i][0] = playerid; format(string, sizeof(string),"[GANG]: You have created the gang '%s' (id: %d)", gangNames[i], i); SendClientMessage(playerid, COLOR_GREEN, string); playerGang[playerid]=i; return 1; } } return 1; //Join Gang// } else if (gangcmd==3) { gangnum = gangInvite[playerid]; if(playerGang[playerid]>0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: You are already in a gang!"); return 1; } if(gangInvite[playerid]==0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: You have not been invited to a gang."); return 1; } if(gangInfo[gangnum][0]==0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: That gang does not exist!"); return 1; } if(gangInfo[gangnum][1] < MAX_GANG_MEMBERS) { new i = gangInfo[gangnum][1]; gangInvite[playerid]=0; gangMembers[gangnum][i] = playerid; GetPlayerName(playerid, sendername, MAX_PLAYER_NAME); for(new j = 0; j < gangInfo[gangnum][1]; j++) { format(string, sizeof(string),"[GANG]: %s has joined your gang.", sendername); SendClientMessage(gangMembers[gangnum][j], COLOR_ORANGE, string); } gangInfo[gangnum][1]++; playerGang[playerid] = gangnum; SetPlayerColor(playerid,gangInfo[gangnum][2]); format(string, sizeof(string),"[GANG]: You have joined the gang '%s' (id: %d)", gangNames[gangnum], gangnum); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } SendClientMessage(playerid, COLOR_RED, "[GANG]: That gang is full."); return 1; //Invite to Gang// } else if (gangcmd==2) { giveplayerid = strval(tmp); if(playerGang[playerid]==0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: You are not in a gang!"); return 1; } // if(gangMembers[playerGang[playerid]][0]!=playerid) { // SendClientMessage(playerid, COLOR_RED, "You need to be the gang leader to send an invite."); // return 1; // } if(IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string),"[GANG]: You have sent a gang invite to %s.", giveplayer); SendClientMessage(playerid, COLOR_GREEN, string); format(string, sizeof(string),"[GANG]: You have recieved a gang invite from %s to '%s' (id: %d)", sendername, gangNames[playerGang[playerid]],playerGang[playerid]); SendClientMessage(giveplayerid, COLOR_GREEN, string); gangInvite[giveplayerid]=playerGang[playerid]; } else SendClientMessage(playerid, COLOR_RED, "[GANG]: No such player exists!"); //Leave Gang// } else if (gangcmd==4) { PlayerLeaveGang(playerid); } return 1; } //------------------- /ganginfo if(strcmp(cmd, "/ganginfo", true) == 0) { new tmp[256]; new gangnum; tmp = strtok(cmdtext, idx); if(!strlen(tmp) && playerGang[playerid]==0) { SendClientMessage(playerid, COLOR_WHITE, "[USAGE:] /ganginfo [number]"); return 1; } else if (!strlen(tmp)) gangnum = playerGang[playerid]; else gangnum = strval(tmp); if(gangInfo[gangnum][0]==0) { SendClientMessage(playerid, COLOR_RED, "[GANG]: No such gang exists!"); return 1; } format(string, sizeof(string),"'%s' Gang Members (id: %d)", gangNames[gangnum], gangnum); SendClientMessage(playerid, COLOR_GREEN, string); for(new i = 0; i < gangInfo[gangnum][1]; i++) { GetPlayerName(gangMembers[gangnum][i], giveplayer, sizeof(giveplayer)); format(string, sizeof(string),"%s (%d)", giveplayer, gangMembers[gangnum][i]); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } //------------------- /gangs if(strcmp(cmd, "/gangs", true) == 0) { new x; SendClientMessage(playerid, COLOR_GREEN, "Current Gangs:"); for(new i=0; i < MAX_GANGS; i++) { if(gangInfo[i][0]==1) { format(string, sizeof(string), "%s%s(%d) - %d members", string,gangNames[i],i,gangInfo[i][1]); x++; if(x > 2) { SendClientMessage(playerid, COLOR_YELLOW, string); x = 0; format(string, sizeof(string), ""); } else { format(string, sizeof(string), "%s, ", string); } } } if(x <= 2 && x > 0) { string[strlen(string)-2] = '.'; SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } //-----------teleports if(strcmp(cmd, "/lv", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1713.4164,1446.8452,10.7722); else SetPlayerPos(playerid,1682.4164,1446.8452,10.7722); return 1; } if(strcmp(cmd, "/wang", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-2003.3442,288.9917,34.6972); else SetPlayerPos(playerid,-1929.3132,249.4710,40.7176); return 1; } if(strcmp(cmd, "/Grove", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2491.2063,-1665.5610,13.3438); else SetPlayerPos(playerid,2466.0586,-1669.8325,13.4758); return 1; } /* if(strcmp(cmd, "/bobafett20", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),-2625.08,1401.04,7.10); else SetPlayerPos(playerid,-2625.08,1401.04,7.10); SendClientMessage(playerid,COLOR_RED,"[RS]: You Are Now Logged in."); ResetPlayerWeapons(playerid); SetPlayerColor(playerid, COLOR_ORANGE); GivePlayerWeapon(playerid, 25, 500); return 1; } if(strcmp(cmd, "/armyiuserazor", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),218.57,1868.16,13.14); else SetPlayerPos(playerid,218.57,1868.16,13.14); SendClientMessage(playerid,COLOR_GREEN,"Army: You Are Now Logged in."); SetPlayerColor(playerid, COLOR_GREEN); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 500); return 1; } if(strcmp(cmd, "/swat07uk", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),950.40,1711.16,8.73); else SetPlayerPos(playerid,950.40,1711.16,8.73); SendClientMessage(playerid,COLOR_BLUE,"SWAT: You Are Now Logged in."); SetPlayerColor(playerid, COLOR_BLUE); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 500); return 1; } if(strcmp(cmd, "/redadminftw", true) == 0) { SendClientMessage(playerid,COLOR_RED,"Admin: You Are Now Red."); SetPlayerColor(playerid, COLOR_RED); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 25, 500); return 1; } */ if(strcmp(cmd, "/Drift", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2289.8887,1393.3649,42.5641); else SetPlayerPos(playerid,2327.1433,1386.7778,42.8203); SendClientMessageToAll(COLOR_YELLOW,"A player has entered a drift race"); SendClientMessageToAll(COLOR_YELLOW,"Type /Drift to join"); SendClientMessage(playerid,COLOR_YELLOW,"Type /Countdown to Begin"); SendClientMessage(playerid,COLOR_YELLOW,"Welcome to Drift"); return 1; } if(strcmp(cmd, "/Park", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),1880.7683,-1384.0571,13.4099); else SetPlayerPos(playerid,1958.3021,-1457.9878,13.2228); return 1; } if(strcmp(cmd, "/Loco", true) == 0) { if (IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),2657.1306,-2003.4412,12.9530); else SetPlayerPos(playerid,2659.3164,-2010.1752,13.1287); return 1; } if(strcmp(cmd, "/Dm", true) == 0) { SetPlayerPos(playerid,2585.8291,2825.6921,19.9922); // SendClientMessageToAll(COLOR_RED,"A player has entered the deathmatch arena!"); // SendClientMessageToAll(COLOR_YELLOW,"Type /DM to join them!"); return 1; } if(strcmp(cmd, "/me", true) == 0) { new dir[256]; new tmp[256]; dir = strtok(cmdtext, idx); strmid(tmp, cmdtext, 4, strlen(cmdtext)); if(!strlen(dir)) { SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /me [message]"); return 1; } dir = strtok(cmdtext, idx); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "***%s %s", sendername, tmp); SendClientMessageToAll(COLOR_GREEN,string); format(string, sizeof(string), "***%s %s", sendername, tmp); print(string); return 1; } if(strcmp(cmd, "/jail", true) == 0) { if(IsPlayerAdmin(playerid) == 1) { new dir[256]; dir = strtok(cmdtext, idx); if(!strlen(dir)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid]"); return 1; } giveplayerid = strval(dir); dir = strtok(cmdtext, idx); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); SetPlayerInterior(giveplayerid,3); SetPlayerPos(giveplayerid,197.7029,174.8801,1003.0234); SendClientMessage(playerid, COLOR_RED, "Jailed!"); SendClientMessage(giveplayerid, COLOR_RED, "You have been jailed by the police. You will be"); SendClientMessage(giveplayerid, COLOR_RED, "released by the admins when they deem it fit."); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } else { SendClientMessage(playerid, COLOR_RED, "Permission denied, you are not an admin!"); } } if(strcmp(cmd, "/unjail", true) == 0) { if(IsPlayerAdmin(playerid) == 1) { new dir1[256]; dir1 = strtok(cmdtext, idx); if(!strlen(dir1)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unjail [playerid]"); return 1; } giveplayerid = strval(dir1); dir1 = strtok(cmdtext, idx); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); GivePlayerMoney(giveplayerid,(0 - 3000)); GivePlayerMoney(playerid, 3000); SetPlayerInterior(giveplayerid,0); SetPlayerPos(giveplayerid,2297.1064,2452.0115,10.8203); SendClientMessage(playerid, COLOR_GREEN, "Released!"); SendClientMessage(giveplayerid, COLOR_GREEN, "You have been released and fined $3000 by the police."); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; } else { SendClientMessage(playerid, COLOR_RED, "Permission denied, you are not an admin!"); } } if (strcmp(cmdtext, "/countdown", true)==0) { if(Count >= 5) { SendClientMessageToAll(COLOR_GREEN, "Countdown Started......"); CountDown(); return 1; } else { SendClientMessage(playerid, COLOR_RED, "Countdown in progress"); return 1; } } return 0; } //------------------------------------------------------------------------------------------------------ public CountDown(){ if (Count > 0){ GameTextForAll( CountText[Count-1], 999, 5); Count--; SetTimer("CountDown", 1000, 0); } else{ GameTextForAll("~g~Go! Go! Go!", 999, 5); Count = 5; } } public OnPlayerText(playerid, text[]) { if(text[0] == '!') { if(playerGang[playerid] > 0) { new gangChat[256]; new senderName[MAX_PLAYER_NAME]; new string[256]; // for(new i = 1; i < strlen(text)+1; i++) // gangChat[i]=text[i]; strmid(gangChat,text,1,strlen(text)); GetPlayerName(playerid, senderName, sizeof(senderName)); format(string, sizeof(string),"%s: %s", senderName, gangChat); for(new i = 0; i < gangInfo[playerGang[playerid]][1]; i++) { SendClientMessage(gangMembers[playerGang[playerid]][i], COLOR_LIGHTBLUE, string); } } return 0; } return 1; } //------------------------------------------------------------------------------------------------------ public OnPlayerSpawn(playerid) { // SetVehicleParamsForPlayer(CAR_MARKER_PIRATE,playerid,1,1); // SetVehicleParamsForPlayer(CAR_MARKER_STORE,playerid,1,1); //SendClientMessage(playerid, COLOR_GREEN, "You are jobless at the moment."); //SendClientMessage(playerid, COLOR_YELLOW, "Type /job to get a job and /jobhelp for more information."); //SendClientMessage(playerid, COLOR_RED, "Type /help for a general help."); /*if(GetPlayerMoney(playerid)>=0) { GivePlayerMoney(playerid, PocketMoney); } iSpawnSet[playerid] = 0; SetPlayerInterior(playerid,0); SetPlayerRandomSpawn(playerid); for(new i = 0; i < MAX_WEAPONS; i++) { if(playerWeapons[playerid][i] > 0) { GivePlayerWeapon(playerid,weaponIDs[i],weaponAmmo[i]*playerWeapons[playerid][i]); } }*/ //new rand_skin = random(sizeof(SkinID)); //SetPlayerSkin(playerid, SkinID[rand_skin]); GivePlayerMoney(playerid, PocketMoney); if (PLAYERLIST_authed[playerid]) { new rand = random(sizeof(gRandomPlayerSpawns)); dUserSetINT(PlayerName(playerid)).("x",floatround(gRandomPlayerSpawns[rand][0])); dUserSetINT(PlayerName(playerid)).("y",floatround(gRandomPlayerSpawns[rand][1])); dUserSetINT(PlayerName(playerid)).("z",floatround(gRandomPlayerSpawns[rand][2])); SetTimer("PutAtPos",2000,0); GivePlayerWeapon(playerid, 5, -1); GivePlayerWeapon(playerid, 22, 50); /* iSpawnSet[playerid] = 0; SetPlayerInterior(playerid,0); SetPlayerRandomSpawn(playerid);*/ } else { SetPlayerPos(playerid,1682.4164,1446.8452,10.7722); gambleWarning[playerid]=0; speedwarned[playerid]=0; SetPlayerColor(playerid, COLOR_WHITE); job[playerid] = 0; } } public SetPlayerRandomSpawn(playerid) { if (iSpawnSet[playerid] == 1) { new rand = random(sizeof(gCopPlayerSpawns)); SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player SetPlayerFacingAngle(playerid, 270.0); } else if (iSpawnSet[playerid] == 0) { new rand = random(sizeof(gRandomPlayerSpawns)); SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player } return 1; } //------------------------------------------------------------------------------------------------------ public OnPlayerDeath(playerid, killerid, reason) { new playercash; new playercashkiller; new killedplayer[MAX_PLAYER_NAME]; new string[256]; playercash = GetPlayerMoney(playerid); GameTextForPlayer(playerid,"~r~You are dead. You money has been reset.",5000,3); speedwarned[playerid] = 0; SetPlayerColor(playerid, COLOR_WHITE); job[playerid] = 0; if(killerid == INVALID_PLAYER_ID) { SendDeathMessage(INVALID_PLAYER_ID,playerid,reason); } else { SendDeathMessage(killerid,playerid,reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1); if(bounty[playerid] > 0 && (playerGang[killerid] == 0 || playerGang[playerid] != playerGang[killerid])) { GetPlayerName(playerid, killedplayer, sizeof(killedplayer)); format(string, sizeof(string), "[BOUNTY]: You earned a bounty of %d for killing %s.", bounty[playerid], killedplayer); SendClientMessage(killerid, COLOR_GREEN, string); GivePlayerMoney(killerid, bounty[playerid]); bounty[playerid] = 0; } if(playercash > 0) { playercashkiller = playercash / 2; GivePlayerMoney(killerid, playercashkiller); ResetPlayerMoney(playerid); } } if(playercash > 0) { ResetPlayerMoney(playerid); } return 1; } //------------------------------------------------------------------------------------------------------ public OnPlayerEnterCheckpoint(playerid) { new string[256]; new ownplayer[MAX_PLAYER_NAME]; switch(getCheckpointType(playerid)) { case CP_BANK: { SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: To store money use '/bank amount', to withdraw"); SendClientMessage(playerid, COLOR_YELLOW, "[BANK]: money use '/withdraw amount', and '/balance' to see your balance."); } case CP_PIRATE: { SendClientMessage(playerid, COLOR_YELLOW, "[PIRATE]: You can hold the pirate ship area to gain money."); } case CP_AMMU: { SendClientMessage(playerid, COLOR_GREEN, "[WEAPONS]: You can purchase weapons here so that you have them every"); SendClientMessage(playerid, COLOR_GREEN, "[WEAPONS]: time you spawn. You can purchase more than once for more ammo."); SendClientMessage(playerid, COLOR_YELLOW, "[WEAPONS]: Type /buyweapon [weapon number] and /weaponlist for a list of weapons."); } /* case CP_ADMIN: { if (!player_op[playerid] || !IsPlayerAdmin(playerid)) { GameTextForPlayer(playerid,"~r~This is the admin roof.~n~KEEP OUT.",1800,1); SetPlayerPos(playerid,-372.5452,2127.5845,133.1091); } }*/ /* case CP_SEXSHOP: { SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Sex Shop for $25,000 with /buy."); SendClientMessage(playerid, COLOR_YELLOW, "You will earn $2,000 regularly."); } case CP_BAR: { SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Shithole Bar for $20,000 with /buy."); SendClientMessage(playerid, COLOR_YELLOW, "You will earn $1,500 regularly."); } case CP_CALIGULA: { SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Caligula Casino for $100,000 with /buy."); SendClientMessage(playerid, COLOR_YELLOW, "You will earn $7,000 regularly."); } case CP_ZIP: { SendClientMessage(playerid, COLOR_YELLOW, "You can buy the Zip clothes store for $15,000 with /buy."); SendClientMessage(playerid, COLOR_YELLOW, "You will earn $1,000 regularly."); }*/ } if(getCheckpointType(playerid)>= P_OFFSET) { format(string, sizeof(string), "[PROP]: You can buy the %s for $%d with /buy.", propertyNames[playerCheckpoint[playerid]-P_OFFSET], propertyValues[playerCheckpoint[playerid]-P_OFFSET]); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "[PROP]: You will earn $%d regularly.", propertyEarnings[playerCheckpoint[playerid]-P_OFFSET]); SendClientMessage(playerid, COLOR_YELLOW, string); if(propertyOwner[playerCheckpoint[playerid]-P_OFFSET]<999) { GetPlayerName(propertyOwner[playerCheckpoint[playerid]-P_OFFSET], ownplayer, sizeof(ownplayer)); format(string, sizeof(string), "[PROP]: This property is currently owned by %s.", ownplayer); SendClientMessage(playerid, COLOR_RED, string); } } } //------------------------------------------------------------------------------------------------------ /*public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new string[256]; //for (new i=0 ; i= 1305.7489 && X <= 1372.4907 && Y >= -666.4764&& Y <= -602.6023) //REPLACE XMIN,XMAX,YMIN,YMAX by your coordinates //if((X >= 388.6190 && X <= -7.9993 && Y >= 2147.0618 && Y <= 1655.8849)) //REPLACE XMIN,XMAX,YMIN,YMAX by your coordinates //388.6190, -7.9993, 2147.0618, 1655.8849 A51 { if (!IsPlayerAdmin(i) || player_op[i] == 0) { GameTextForPlayer(i,"~r~You're not allowed in the Admin Area! Please login as Admin to access this area.",5000,5); //GetPlayerHealth(i, phealth); SetPlayerHealth(i, 0); } } } } */ public AdminArea(playerid) { new i, j, Float:X, Float:Y, Float:Z; for (i = 0, j = MAX_PLAYERS; i < j; i++) { GetPlayerPos(playerid, X, Y, Z); if(X >= -764.5396 && X <= -632.9658 && Y >= 802.6583 && Y <= 1015.8968) { //Replace with your own x/y min/max coords if (IsPlayerAdmin(playerid) /*|| Level[playerid] == Admin*/) { //nothing :D } else { SetTimer("AdminAreaAbuse", 1000, 0); GameTextForPlayer(playerid,"~r~You are not allowed to go to the admin Area!",5000,5); SendClientMessage(playerid, COLOR_RED, "Please login as Admin to access this area!"); SetPlayerHealth(playerid, -99999999.99); } }} } public AdminAreaAbuse(playerid) { new string[256]; new name[256]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string, sizeof(string), "%s tried to enter the admin area. Autokilled!", name); SendClientMessageToAll(COLOR_RED, string); KillTimer(AdminAreaAbuse(playerid)); }