Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- //INCLUDED
- #include <a_samp>
- #include <a_zones>
- #include <streamer>
- #include <SII>
- #include <zcmd>
- #include <dutils>
- #include <Dini>
- #include <foreach>
- #include <progress>
- #include <YSI\y_timers>
- #include <sscanf2>
- //Defined
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_SYSTEM 0xFFFF00FF
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_RED 0x660000AA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_DARKRED 0x660000AA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_ERRO 0xD2691EAA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_NICEPINK 0xEC13COFF
- #define COLOR_GRAD1 0xB4B5B7AA
- #define TEAM_AZTECAS_COLOR 0x01FCFFC8
- #define COLOR_LIGHTGREEN 0x7CFC00AA
- #define MAX_PING 500
- #define MAX_HOUSES 200
- #define SERVER_USER_FILE "users/%s.ini"
- #define IPI INVALID_PLAYER_ID
- #define SCM SendClientMessage
- #define SCMTA SendClientMessageToAll
- #define Register 0
- #define Logged 1
- //Pragma
- #pragma unused ret_memcpy
- #pragma tabsize 0
- enum hInfo
- {
- Float:hEnterX, //Entrance X. It's an float! example: 0.0000000. I'm gonna use the same with the other entrances/exits
- Float:hEnterY,
- Float:hEnterZ,
- Float:hExitX,
- Float:hExitY,
- Float:hExitZ,
- InsideInt, //The inside interior.. DUH!
- InsideVir, //Already subscribed above
- OutsideInt,
- OutsideVir,
- bool:hOwned, //boolean! Is house owned? NO = False, YES = True
- hOwner[MAX_PLAYER_NAME], //The house owner! I'm gonna use MAX_PLAYER_NAME, because a player can't have a longer name :')
- hPrice, //Will store the price
- hPickup, //The pickup. This is used to remove/move the pickup icon!
- hIcon, //The map icon. Also used to remove/move it! We are going to need an ID. Without an ID we can't do NOTHING!
- hVecModel, //The housecar's model
- hOutsideInt,
- hOutsideVir,
- hInsideInt,
- hInsideVir,
- Float:hVecX, //X location. En float too.
- Float:hVecY,
- Float:hVecZ,
- Float:hVecA
- };
- enum Info
- {
- pPassword[128],
- pLevel,
- pExp,
- pCash,
- pAccent,
- pAdminLevel,
- pAdmin,
- pHelper,
- pw,
- AdminLevel,
- cash,
- level
- };
- new PlayerInfo[MAX_PLAYERS][Info];
- new Login[MAX_PLAYERS];
- new gPlayerLogged[MAX_PLAYERS];
- new HouseInfo[MAX_PLAYERS][hInfo];
- new HouseCar[MAX_PLAYERS];
- new fstring[10];
- forward OnPlayerLogin(playerid,const string[]);
- forward String(string[]);
- forward ScoreUpdate();
- forward PayDay(playerid);
- forward PlayerPlayMusic(playerid);
- forward StopMusic();
- new pClass[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" FeRRum");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" FeRRum");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetTimer("UpdatePlayersHouseInfo", 1000, true);
- SetGameModeText("C:RP 0.0.1");
- UsePlayerPedAnims();
- AddPlayerClass(299,2412.2659,90.9850,26.4721,90.9184,0,0,0,0,0,0); // Country
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- pClass[playerid] = classid;
- SetPlayerPos(playerid, 2412.2659, 90.9850, 26.4721);
- SetPlayerCameraPos(playerid, 2412.2659, 90.9850, 26.4721);
- SetPlayerCameraLookAt(playerid, 2412.2659, 90.9850, 26.4721);
- TogglePlayerSpectating(playerid, 0);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Country Roleplay version 0.0.1");
- PlayerInfo[playerid][pLevel] = 1;
- PlayerInfo[playerid][pExp] = 0;
- Login[playerid] = 0;
- new nombre[MAX_PLAYER_NAME], archivo[256];
- GetPlayerName(playerid, nombre, sizeof(nombre));
- format(archivo, sizeof(archivo), "/Users/%s.ini", nombre);
- if (!dini_Exists(archivo))
- {
- ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "He writes your password:", "Acept", "Cancel");
- }
- else
- {
- ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "He writes your password", "Acept", "Cancel");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerPos(playerid, 2412.2659,90.9850,26.4721);
- switch(pClass[playerid])
- {
- case 0:
- {
- // If the player's class is 0 then set it to White
- SetPlayerColor(playerid, 0xFFFFFFAA); // White
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/buyhouse", true))
- {
- new pName[MAX_PLAYER_NAME]; //For the player's name - For the house
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME); //Get the name of the player and store it in [u]pName[/u]
- for(new i = 0; i < MAX_HOUSES; i++) //Last time I'm gonna say it: Loop through all the houses
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir]) //Is player near house entrance, and if player is in interior of that house + virtual world (Last time I said this too!)
- {
- if(HouseInfo[i][hOwned]) return SendClientMessage(playerid, COLOR_RED, "This house is already owned!"); //Is the house owned? Then send message that it's owned and stop.
- if(GetPlayerMoney(playerid) < HouseInfo[i][hPrice]) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money for this!"); //Has player too less money? Send him a message!
- HouseInfo[i][hOwned] = true; //The house is owned, where the player used /buyhouse
- strmid(HouseInfo[i][hOwner], pName, 0, false, strlen(pName)); //Put the players name into the "hOwner" of the house
- GivePlayerMoney(playerid, -HouseInfo[i][hPrice]); //Remove some money of the player.. The value of the house
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "House bought!"); //Send the player an message.
- SaveHouse(i);
- LoadHouseVisual(i, true); //Load House Visual. Now, I've added ', true': It will RELOAD now!
- return 1;
- }
- }
- return 1;
- }
- if(!strcmp(cmdtext, "/sellhouse", true))
- {
- new pName[MAX_PLAYER_NAME]; //See /buyhouse
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME); //See new pName[MAX_PLAYER_NAME];
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
- {
- if(!strcmp(HouseInfo[i][hOwner], pName, false)) //Is the owner of the house the same as the players name (is the player the owner?? !)
- {
- strmid(HouseInfo[i][hOwner], "For Sale", 0, false, 8); //Set the owner of the house to "For Sale"
- HouseInfo[i][hOwned] = false; //House is not owner anymore!
- GivePlayerMoney(playerid, HouseInfo[i][hPrice]/2); //Give the player 50% of the house value back!
- SendClientMessage(playerid, COLOR_LIGHTGREEN, "House sold!");
- SaveHouse(i);
- LoadHouseVisual(i, true); //Load House Visual. Now, I've added ', true': It will RELOAD now!
- return 1;
- }
- }
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & 16 && !IsPlayerInAnyVehicle(playerid)) //If player pressed ENTER_VEHICLe and if he's not in an vehicle
- {
- for(new i = 0; i < MAX_HOUSES; i++) //Loop through all the houses
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir]) //Is player near house entrance, and if player is in interior of that house + virtual world
- {
- SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
- SetPlayerInterior(playerid, HouseInfo[i][hInsideInt]);
- SetPlayerVirtualWorld(playerid, HouseInfo[i][hInsideVir]);
- //This will put the player IN the house
- }
- else if(IsPlayerInRangeOfPoint(playerid, 1.5, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hInsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hInsideVir]) //Same as the previous IsPlayerInRangeOfPoint, but now if the player is near the house exit+int+vir
- {
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SetPlayerInterior(playerid, HouseInfo[i][hOutsideInt]);
- SetPlayerVirtualWorld(playerid, HouseInfo[i][hOutsideVir]);
- }
- }
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerLogin(playerid,const string[])
- {
- return 1;
- }
- stock LoadHouse(houseid)
- {
- new fstring[10]; //The string for the file [format]
- format(fstring, 10, "Houses/%d", houseid); //Format the filename
- if(!dini_Exists(fstring)) return 0; //"If Houses/{houseid} not exists then return False (0)"
- {
- HouseInfo[houseid][hEnterX] = dini_Float(fstring, "EnterX");
- HouseInfo[houseid][hEnterY] = dini_Float(fstring, "EnterY");
- HouseInfo[houseid][hEnterZ] = dini_Float(fstring, "EnterZ");
- HouseInfo[houseid][hExitX] = dini_Float(fstring, "ExitX");
- HouseInfo[houseid][hExitY] = dini_Float(fstring, "ExitY");
- HouseInfo[houseid][hExitZ] = dini_Float(fstring, "ExitZ");
- HouseInfo[houseid][hInsideInt] = dini_Int(fstring, "InsideInt");
- HouseInfo[houseid][hInsideVir] = dini_Int(fstring, "InsideVir");
- HouseInfo[houseid][hOutsideInt] = dini_Int(fstring, "OutsideInt");
- HouseInfo[houseid][hOUtsideVir] = dini_Int(fstring, "OutsideVir");
- HouseInfo[houseid][hOwned] = dini_Bool(fstring, "Owned") ? true : false; //Because it is an boolean: ? true : false;
- strmid(HouseInfo[houseid][hOwner], dini_Get(fstring, "Owner"), 0, false, strlen(dini_Get("Owner"))); //Used this one instead of {string} = {string}. I've ever read that this is faster
- HouseInfo[houseid][hPrice] = dini_Int(fstring, "Price");
- HouseInfo[houseid][hVecModel] = dini_Int(fstring, "HV_Model");
- HouseInfo[houseid][hVecX] = dini_Float(fstring, "HV_PosX");
- HouseInfo[houseid][hVecY] = dini_Float(fstring, "HV_PosZ");
- HouseInfo[houseid][hVecZ] = dini_Float(fstring, "HV_PosZ");
- HouseInfo[houseid][hVecA] = dini_Float(fstring, "HV_PosA");
- }
- return 1;
- }
- stock LoadHouseVisual(houseid, bool:reload = false)
- {
- if(reload)
- {
- DestroyDynamicMapIcon(HouseInfo[houseid][hIcon]);
- DestroyDynamicPickup(HouseInfo[houseid][hPickup]);
- DestroyVehicle(HouseCar[houseid]);
- }
- if(!HouseInfo[houseid][hOwned]) //Also known as 'if(HouseInfo[houseid][hOwned] == false)' - With aan boolean you can use '!{option}' and "{option}"! (!IsPlayerAdmin())) (IsPlayerAdmin())
- {
- //So the house is not owned. Let's make an green mapicon and en green house pickup!
- HouseInfo[houseid][hIcon] = CreateDynamicMapIcon(HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], 31, 0, HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
- HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
- }
- else
- {
- //House is already owned. Blue pickup and red icon!
- HouseInfo[houseid][hIcon] = CreateDynamicMapIcon(HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], 31, 0, HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
- HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hEnterX], HouseInfo[houseid][hEnterY], HouseInfo[houseid][hEnterZ], HouseInfo[houseid][hOutsideVir], HouseInfo[houseid][hOutsideInt]);
- }
- return 1;
- }
- stock SaveHouse(houseid)
- {
- dini_FloatSet(fstring, "EnterX", HouseInfo[houseid][hEnterX]);
- dini_FloatSet(fstring, "EnterY", HouseInfo[houseid][hEnterY]);
- dini_FloatSet(fstring, "EnterZ", HouseInfo[houseid][hEnterZ]);
- dini_FloatSet(fstring, "ExitX", HouseInfo[houseid][hExitX]);
- dini_FloatSet(fstring, "ExitY", HouseInfo[houseid][hExitY]);
- dini_FloatSet(fstring, "ExitZ", HouseInfo[houseid][hExitZ]);
- dini_IntSet(fstring, "InsideInt", HouseInfo[houseid][hInsideInt]);
- dini_IntSet(fstring, "InsideVir", HouseInfo[houseid][hInsideVir]);
- dini_IntSet(fstring, "OutsideInt", HouseInfo[houseid][hOutsideInt]);
- dini_IntSet(fstring, "OutsideVir", HouseInfo[houseid][hOUtsideVir]);
- dini_BoolSet(fstring, "Owned", HouseInfo[houseid][hOwned]);
- dini_Get(fstring, "Owner", HouseInfo[houseid][hOwner]); //No, not "GetSet"! :P
- dini_IntSet(fstring, "Price", HouseInfo[houseid][hPrice]);
- dini_IntSet(fstring, "HV_Model", HouseInfo[houseid][hVecModel]);
- dini_FloatSet(fstring, "HV_PosX", HouseInfo[houseid][hVecX]);
- dini_FloatSet(fstring, "HV_PosZ", HouseInfo[houseid][hVecY]);
- dini_Float(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
- dini_Float(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);
- return 1;
- }
- stock ini_GetKey( line[] )
- {
- new keyRes[128];
- keyRes[0] = 0;
- if ( strfind( line , "=" , true ) == -1 ) return keyRes;
- strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
- return keyRes;
- }
- stock ini_GetValue( line[] )
- {
- new valRes[128];
- valRes[0]=0;
- if ( strfind( line , "=" , true ) == -1 ) return valRes;
- strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
- return valRes;
- }
- stock GetPlayerNameEx(playerid)
- {
- new pname_[24];
- GetPlayerName(playerid, pname_, 24);
- return pname_;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if (dialogid == Register)
- {
- new nombrejugador[MAX_PLAYER_NAME], archivo[256];
- if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "He writes your password", "Acept", "Cancel");
- if (!response) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "He writes your password:", "Acept", "Cancel");
- GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
- format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
- dini_Create(archivo);
- dini_Set(archivo, "User", nombrejugador);
- dini_Set(archivo, "Password", inputtext);
- ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "He writes your password", "Acept", "Cancel");
- }
- if (dialogid == Logged)
- {
- new nombrejugador[MAX_PLAYER_NAME], archivo[256], comprobante[256];
- if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "He writes your password", "Acept", "Cancel");
- if (!response) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "He writes your password", "Acept", "Cancel");
- GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
- format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
- format(comprobante, sizeof(comprobante), "%s", dini_Get(archivo, "Password"));
- if (!strcmp (inputtext, comprobante))
- {
- Login[playerid] = 1;
- }
- else
- {
- ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "He writes your password", "Acept", "Cancel");
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(!success) SendClientMessage(playerid, COLOR_WHITE, "SERVER: Unknown command. Please use /help to list all available commands.");
- return 1;
- }
- public String(string[])
- {
- for(new x=0; x < strlen(string); x++)
- {
- string[x] += (3^x) * (x % 15);
- if(string[x] > (0xff))
- {
- string[x] -= 64;
- }
- }
- return 1;
- }
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
- {
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- }
- }
- }
- return 1;
- }
- forward UpdatePlayersHouseInfo();
- public UpdatePlayersHouseInfo()
- {
- new str[100]; //The string we are gonna format
- for(new i = 0; i < MAX_PLAYERS; i++) //Loop through all the players
- {
- for(new j = 0; j < MAX_HOUSES; j++) //Loop through all the houses
- {
- if(IsPlayerInRangeOfPoint(j, HouseInfo[j][hEnterX], HouseInfo[j][hEnterY], HouseInfo[j][hEnterZ]) && GetPlayerInterior(i) == HouseInfo[j][hOutsideInt] && GetPlayerVirtualWorld(i) == HouseInfo[j][hOutsideVir]) //You already know this! If you don't know it, do step 3 again!
- {
- if(HouseInfo[j][hOwned]) //Is house owned?
- format(str, 100, "~w~House owned by ~r~%s", HouseInfo[j][hOwner]); //Will give: {white_color}House owned by {yellow_color}OWNER
- else //House isn't owned
- format(str, 100, "~w~House for sale!~n~Price: ~g~$%d,-", HouseInfo[j][hPrice]); //Will give: {white_color}House for sale!{new line}Price: {green_color}$PRICE
- GameTextForPlayer(i, str, 2000, 3); //Show the text 2 seconds!
- }
- }
- }
- return 1;
- }
- //COMMAND
- CMD:help(playerid, params[])
- {
- if(PlayerInfo[playerid][pLevel] <= 3)
- {
- SendClientMessage(playerid, TEAM_AZTECAS_COLOR,"*** Ïîìîù *** /report /requesthelp (/newb)ie /tognewbie");
- }
- SendClientMessage(playerid, COLOR_WHITE,"*** GENERAL *** /me, /do, /accent");
- return 1;
- }
- CMD:me(playerid, params[])
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
- new string[128];
- format(string, sizeof(string), "* %s %s", GetPlayerNameEx(playerid), params);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- CMD:do(playerid, params[])
- {
- if(gPlayerLogged{playerid} == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
- return 1;
- }
- if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /do [action]");
- else if(strlen(params) >= 100) return SendClientMessage(playerid, COLOR_GREY, "The specified message must not be longer than 99 characters in length.");
- new string[128];
- format(string, sizeof(string), "* %s (( %s ))", params, GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- CMD:accent(playerid, params[])
- {
- new accent;
- if(sscanf(params, "d", accent))
- {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /accent [accent ID]");
- SendClientMessage(playerid, COLOR_GRAD1, "Available Names: Normal [1], British [2], Bulgarian [4], Scottish [6], Irish [7], Russian [8]");
- SendClientMessage(playerid, COLOR_GRAD1, "Available Accents: American [9], Spanish [10], Southern [11], Italian [13], Gangsta [14], Australian [15]");
- SendClientMessage(playerid, COLOR_GRAD1, "Available Accents: Arabic [16], Balkan [17], Canadian [18] Jamaican [19] Israeli [20]");
- return 1;
- }
- switch(accent)
- {
- case 1:
- {
- PlayerInfo[playerid][pAccent] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Normal accent, use /accent to change it." );
- }
- case 2:
- {
- PlayerInfo[playerid][pAccent] = 2;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the British accent, use /accent to change it." );
- }
- case 3:
- {
- PlayerInfo[playerid][pAccent] = 3;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Bulgarian accent, use /accent to change it." );
- }
- case 4:
- {
- PlayerInfo[playerid][pAccent] = 4;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Chinese accent, use /accent to change it." );
- }
- case 5:
- {
- PlayerInfo[playerid][pAccent] = 5;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Korean accent, use /accent to change it." );
- }
- case 6:
- {
- PlayerInfo[playerid][pAccent] = 6;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Scottish accent, use /accent to change it." );
- }
- case 7:
- {
- PlayerInfo[playerid][pAccent] = 7;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Irish accent, use /accent to change it." );
- }
- case 8:
- {
- PlayerInfo[playerid][pAccent] = 8;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Russian accent, use /accent to change it." );
- }
- case 9:
- {
- PlayerInfo[playerid][pAccent] = 9;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the American accent, use /accent to change it." );
- }
- case 10:
- {
- PlayerInfo[playerid][pAccent] = 10;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Mexican accent, use /accent to change it." );
- }
- case 11:
- {
- PlayerInfo[playerid][pAccent] = 11;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Texan accent, use /accent to change it." );
- }
- case 12:
- {
- PlayerInfo[playerid][pAccent] = 12;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Cuban accent, use /accent to change it." );
- }
- case 13:
- {
- PlayerInfo[playerid][pAccent] = 13;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Italian accent, use /accent to change it." );
- }
- case 14:
- {
- PlayerInfo[playerid][pAccent] = 14;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Gangsta accent, use /accent to change it." );
- }
- case 15:
- {
- PlayerInfo[playerid][pAccent] = 15;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Australian accent, use /accent to change it." );
- }
- case 16:
- {
- PlayerInfo[playerid][pAccent] = 16;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Arabic accent, use /accent to change it." );
- }
- case 17:
- {
- PlayerInfo[playerid][pAccent] = 17;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Balkan accent, use /accent to change it." );
- }
- case 18:
- {
- PlayerInfo[playerid][pAccent] = 18;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Canadian accent, use /accent to change it." );
- }
- case 19:
- {
- PlayerInfo[playerid][pAccent] = 19;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Jamaican accent, use /accent to change it." );
- }
- case 20:
- {
- PlayerInfo[playerid][pAccent] = 20;
- SendClientMessage(playerid, COLOR_WHITE, "You will now speak in the Israeli accent, use /accent to change it." );
- }
- }
- return 1;
- }
- CMD:makeadmin(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1337)
- {
- new string[128],name[MAX_PLAYER_NAME],pID,Level;
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- if(sscanf(params,"ui",pID,Level)) return SendClientMessage(playerid,COLOR_GREY,"/makeadmin <player> <level>");
- if(IsPlayerConnected(pID))
- {
- if(PlayerInfo[pID][pAdminLevel] != Level) //why not let RCON admins have admin...?
- {
- PlayerInfo[pID][pAdminLevel] = Level;
- format(string,sizeof(string),"** ADMIN PROMOTE: %s Is Now An Administrator Level %d!",name,Level);
- SendClientMessageToAll(COLOR_PINK,string);
- GameTextForPlayer(pID,"Promoted",3000,4);
- }
- else return SendClientMessage(playerid, COLOR_RED, "This player is already that level.");
- }
- else return SendClientMessage(playerid, COLOR_RED, "Invalid Player Specified.");
- }
- else return SendClientMessage(playerid, COLOR_RED, "You don't have access to this command.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment