Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This gamemode is made by Audi_Quattrix
- // It is started on 2012.06.09 at 10:00am
- #include <a_samp>
- #if defined FILTERSCRIPT
- #pragma tabsize 0
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <foreach>
- #include <sscanf>
- #include <dini>
- #include <dudb>
- #pragma unused ret_memcpy
- #define Ferg 1336
- #define DIALOG_REGISTER1 0
- #define DIALOG_REGISTER2 1
- #define DIALOG_REGISTER3 2
- #define DIALOG_REGISTER4 3
- #define DIALOG_LOGIN1 4
- #define DIALOG_NOPW1 5
- #define DIALOG_NOPW2 6
- #define DIALOG_WRONGPW 7
- #define weapons 1111
- #define cars 1112
- // Create a folder "Users" in scriptfiles
- #define SERVER_USER_FILE "Users/%s.ini"
- #include "../include/gl_common.inc"
- // This is For Groves Spawn place
- new Float:gRandomSpawns[][] = //Grove
- {
- {2528.8550,-1667.2024,15.1685},
- {2495.1848,-1688.9705,14.1388},
- {2487.5295,-1647.2445,17.8239},
- {2524.3560,-1677.0464,19.9302}
- };
- // This is For Groves Spawn place
- //----------------------------------------------------------------------------------
- // This is For Ballas Spawn place
- new Float:bRandomSpawns[][] = //Ballas
- {
- {2006.1444,-1116.1742,27.1250},
- {2006.1444,-1116.1742,27.1250},
- {2029.3414,-1122.3053,26.4164},
- {2046.1130,-1116.0215,26.3617}
- };
- // This is For Groves Spawn place
- //----------------------------------------------------------------------------------
- new Float:cRandomSpawns[][] = //Cops
- {
- {1553.5991,-1675.6692,16.1953},
- {1553.5991,-1675.6692,16.1953},
- {1579.5630,-1635.8815,13.5603},
- {1579.5630,-1635.8815,13.5603}
- };
- new Float:vRandomSpawns[][] = //Vagos
- {
- {2579.1199,-1032.9240,72.8701},
- {2319.0576,-1168.7308,27.7298},
- {2359.5972,-1170.6938,28.0039},
- {1808.3914,-1906.7159,13.5736}
- };
- new Float:aRandomSpawns[][] = //Aztecas
- {
- {1767.7189,-1933.3131,13.5621},
- {1771.3771,-1915.1287,13.5549},
- {1790.5698,-1936.6094,13.5469},
- {1771.3771,-1915.1287,13.5549}
- };
- new Float:rRandomSpawns[][] = //Red a.k.a Pirus
- {
- {2415.8403,-1221.0621,25.2201},
- {2405.4163,-1239.6541,23.8125},
- {2393.6394,-1232.1379,25.4369},
- {2421.4116,-1221.0481,29.6202}
- };
- new Float:biRandomSpawns[][] = //Bikers
- {
- {2353.4324,-1366.6510,24.3984},
- {2354.2649,-1358.5103,24.3984},
- {2339.6804,-1374.7615,24.0000},
- {2348.3926,-1373.6440,24.3984}
- };
- new Float:sRandomSpawns[][] = //Skaters
- {
- {1930.4969,-1416.3407,13.7027},
- {1877.2080,-1366.5339,14.6406},
- {1866.9103,-1428.9968,13.8195},
- {1966.3451,-1424.0236,13.7558}
- };
- //=============Colours=================
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_RED 0xF81414AA
- #define COLOR_GREEN "{00FF22}"
- #define COLOR_LIGHTBLUE "{00CED1}"
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GGREEN 0x33AA33AA
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_ORANGE 0xFF8C00AA
- #define COLOR_DRED 0xFF0000AA
- #define COLOR_BROWN 0x654321AA
- //===============new===================
- new total_vehicles_from_files=0;
- new gTeam[MAX_PLAYERS];
- // Stats / Saves
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pKills,
- pDeaths,
- pScore,
- pMuted,
- pVip,
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new gPlayerLogged[MAX_PLAYERS];
- stock SendStaffMessage(color, string[])
- {
- foreach(Player, i) {
- if(PlayerInfo[i][pAdmin] >= 1) {
- SendClientMessage(i, color, string);
- }
- }
- }
- stock CheckPlayerAdmin(targetid)
- {
- new adminrank[11];
- if(PlayerInfo[targetid][pAdmin] == 0) { adminrank = "None"; }
- if(PlayerInfo[targetid][pAdmin] == 1) { adminrank = "Test Admin"; }
- if(PlayerInfo[targetid][pAdmin] == 2) { adminrank = "Moderator"; }
- if(PlayerInfo[targetid][pAdmin] == 3) { adminrank = "Admin"; }
- if(PlayerInfo[targetid][pAdmin] == 4) { adminrank = "Owner"; }
- return adminrank;
- }
- stock GetPlayerNameEx(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- return Name;
- }
- stock GetPlayerIPEx(playerid)
- {
- new IP[15];//Is it 16 :O
- GetPlayerIp(playerid, IP, 15);
- return IP;
- }
- //============================WorldCars=========================================
- // LAS VENTURAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
- // SAN FIERRO
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_Spawn.txt");
- // LOS SANTOS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
- printf("Total vehicles from files: %d",total_vehicles_from_files);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("FreeRoam [NL/RUS/ENG/DE] by Audi_Quattrix");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print("FreeRoam [NL/RUS/ENG/DE]");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- SetGameModeText("FreeRoam [NL/RUS/ENG/DE]");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- if(classid == 0 || classid == 1 || classid == 2 || classid == 3) SetPlayerTeam(playerid,0);
- if(classid == 4 || classid == 5 || classid == 6) SetPlayerTeam(playerid,1);
- if(classid == 7 || classid == 8 || classid == 9) SetPlayerTeam(playerid,2);
- if(classid == 10 || classid == 11 || classid == 12 || classid == 13) SetPlayerTeam(playerid,3);
- if(classid == 14 || classid == 15 || classid == 16) SetPlayerTeam(playerid,4);
- if(classid == 17 || classid == 18 || classid == 19) SetPlayerTeam(playerid,5);
- if(classid == 20 || classid == 21) SetPlayerTeam(playerid,6);
- if(classid == 22 || classid == 23 || classid == 24 || classid == 25) SetPlayerTeam(playerid,7);
- if(classid == 22 || classid == 23 || classid == 24 || classid == 25) SetPlayerTeam(playerid,8);
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- gPlayerLogged[playerid] = 0;
- new pName[30], string[128];
- GetPlayerName(playerid, pName, 30);
- format(string, 256, "{FFFFFF}%s has {00FF22}joined {FFFFFF}the server", pName);
- SendClientMessageToAll(0x33AA33AA,string);
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- if (!dini_Exists(file))
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Your account is not Registered", "Password:", "Register", "Leave");
- }
- if(fexist(file))
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account is registered", "Password:", "Login", "Leave");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- if(gPlayerLogged[playerid] == 1)
- {
- dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
- dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
- dini_IntSet(file, "Admin",PlayerInfo[playerid][pAdmin]);
- dini_IntSet(file, "Kills",PlayerInfo[playerid][pKills]);
- dini_IntSet(file, "Deaths",PlayerInfo[playerid][pDeaths]);
- dini_IntSet(file, "Muted",PlayerInfo[playerid][pMuted]);
- dini_IntSet(file, "Vip",PlayerInfo[playerid][pVip]);
- }
- gPlayerLogged[playerid] = 0;
- new
- string[64];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- switch(reason) {
- case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
- case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
- case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
- }
- SendClientMessageToAll(0xFFFFFFAA,string);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,50);
- new string[128];
- if (PlayerInfo[playerid][pAdmin] <1 || !IsPlayerAdmin(playerid))
- if (GetPlayerPing(playerid) > 600)
- {
- format(string,sizeof(string),"[Server]: Player %s Have been kicked from server (High Ping, %d /600)",GetPlayerNameEx(playerid),GetPlayerPing(playerid));
- SendClientMessageToAll(COLOR_DRED, string);
- printf(string);
- Kick(playerid);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pKills]++;
- PlayerInfo[playerid][pDeaths]++;
- GameTextForPlayer(playerid,"~w~YOU ~r~DIED",1000,1);
- SendDeathMessage(killerid,playerid,reason);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- if(gTeam[playerid] == TEAM_GROVE)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- Team[playerid] = Create3DTextLabel("Grove Street Family",COLOR_GREEN,X, Y, Z+2.0,20.0,1); // Creating 3D Text Label
- Attach3DTextLabelToPlayer(Team[playerid],playerid,0,0,1.2);
- SetPlayerColor(playerid, COLOR_GREEN);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(gRandomSpawns));
- SetPlayerPos(playerid, gRandomSpawns[rand][0], gRandomSpawns[rand][1], gRandomSpawns[rand][2]);
- }
- else if(gTeam[playerid] == TEAM_BALLAS)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_PURPLE, "Rollin Heights Ballas");
- SetPlayerColor(playerid, COLOR_PURPLE);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(bRandomSpawns));
- SetPlayerPos(playerid, bRandomSpawns[rand][0], bRandomSpawns[rand][1], bRandomSpawns[rand][2]);
- }
- else if(gTeam[playerid] == TEAM_VAGOS)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_YELLOW, "Los Colinas Vagos");
- SetPlayerColor(playerid, COLOR_YELLOW);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(vRandomSpawns));
- SetPlayerPos(playerid, vRandomSpawns[rand][0], vRandomSpawns[rand][1], vRandomSpawns[rand][2]);
- }
- else if(gTeam[playerid] == TEAM_AZTECAS)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_LIGHTBLUE, "Varrios Los Aztecas");
- SetPlayerColor(playerid, COLOR_LIGHTBLUE);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(aRandomSpawns));
- SetPlayerPos(playerid, aRandomSpawns[rand][0], aRandomSpawns[rand][1], aRandomSpawns[rand][2]);
- }
- else if(gTeam[playerid] == TEAM_COPS)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_BLUE, "Los Santos Police Department");
- SetPlayerColor(playerid, COLOR_BLUE);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(cRandomSpawns));
- SetPlayerPos(playerid, cRandomSpawns[rand][0], cRandomSpawns[rand][1], cRandomSpawns[rand][2]);
- }
- else if(gTeam[playerid] == TEAM_SKATERS)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_WHITE, "Glen Park Skaters");
- SetPlayerColor(playerid, COLOR_WHITE);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(sRandomSpawns));
- SetPlayerPos(playerid, sRandomSpawns[rand][0], sRandomSpawns[rand][1], sRandomSpawns[rand][2]);
- }
- else if(gTeam[playerid] == TEAM_BIKERS)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_BROWN, "East Los Santos Bikers");
- SetPlayerColor(playerid, COLOR_BROWN);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(biRandomSpawns));
- SetPlayerPos(playerid, biRandomSpawns[rand][0], biRandomSpawns[rand][1], biRandomSpawns[rand][2]);
- }
- else if(gTeam[playerid] == TEAM_RED)
- {
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_RED, "Jefferson Pirus");
- SetPlayerColor(playerid, COLOR_RED);
- GivePlayerWeapon(playerid, 5, 9999);
- GivePlayerWeapon(playerid, 22, 60);
- GivePlayerWeapon(playerid, 25, 25);
- GivePlayerWeapon(playerid, 28, 100);
- GivePlayerWeapon(playerid, 30, 100);
- new rand = random(sizeof(rRandomSpawns));
- SetPlayerPos(playerid, rRandomSpawns[rand][0], rRandomSpawns[rand][1], rRandomSpawns[rand][2]);
- }
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
- if(text[0] == '!')
- {
- new str[128];
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- format(str, sizeof(str), "[GANG CHAT] %s: %s", playername, text[1]);
- for(new i = 0; i < MAX_PLAYERS; i++)
- if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid])
- SendClientMessage(i, COLOR_ORANGE, str);
- return 0;
- }
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- 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)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- new string[128], Float:Ratio = (float(PlayerInfo[clickedplayerid][pKills])/float(PlayerInfo[clickedplayerid][pDeaths]));
- format(string, sizeof(string), "------------------------------------[%s]-------------------------------", GetPlayerNameEx(playerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Admin]: %s ||", CheckPlayerAdmin(clickedplayerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Money]: %d ||", GetPlayerMoney(clickedplayerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Score]: %d ||", GetPlayerScore(clickedplayerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Kills]: %d ||", PlayerInfo[clickedplayerid][pKills]);
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Deaths]: %d ||", PlayerInfo[clickedplayerid][pDeaths]);
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Ratio]: %.2f ||", Ratio);
- SendClientMessage(playerid, COLOR_GGREEN, string);
- GetPlayerVersion(clickedplayerid,string,sizeof(string));
- format(string,sizeof(string),"|| [SA-MP version]: %s ||",string);
- SendClientMessage(playerid, COLOR_GGREEN,string);
- return 1;
- }
- CMD:stats(playerid)
- {
- new string[128], Float:Ratio = (float(PlayerInfo[playerid][pKills])/float(PlayerInfo[playerid][pDeaths]));
- format(string, sizeof(string), "------------------------------------[%s]-------------------------------", GetPlayerNameEx(playerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Admin]: %s ||", CheckPlayerAdmin(playerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Money]: %d ||", GetPlayerMoney(playerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Score]: %d ||", GetPlayerScore(playerid));
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Kills]: %d ||", PlayerInfo[playerid][pKills]);
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Deaths]: %d ||", PlayerInfo[playerid][pDeaths]);
- SendClientMessage(playerid, COLOR_GGREEN, string);
- format(string, sizeof(string), "|| [Ratio]: %.2f ||", Ratio);
- SendClientMessage(playerid, COLOR_GGREEN, string);
- GetPlayerVersion(playerid,string,sizeof(string));
- format(string,sizeof(string),"|| [SA-MP version]: %s ||",string);
- SendClientMessage(playerid, COLOR_GGREEN,string);
- return 1;
- }
- CMD:gmx(playerid)
- {
- if (PlayerInfo[playerid][pAdmin] >=4 ||IsPlayerAdmin(playerid))
- SendRconCommand("gmx");
- else
- SendClientMessage(playerid,COLOR_DRED,"You are not an Admin");
- return 1;
- }
- CMD:aduty(playerid)
- {
- if(PlayerInfo[playerid][pAdmin] >=1 || IsPlayerAdmin(playerid))
- SetPlayerHealth(playerid,100);
- SetPlayerColor(playerid,COLOR_DRED);
- format(string,sizeof(string), "%s is now on Duty!",GetPlayerNameEx(playerid));
- SendClientMessageToAll(COLOR_DRED,string);
- SendClientMessage(playerid,COLOR_DRED,"You are now on duty!");
- }
- CMD:get(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >=3 || IsPlayerAdmin(playerid))
- {
- new Float:x,Float:y, Float:z;
- new giveplayerid;
- if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_DRED, "SYNTAX: /Get <Playerid>");
- if(IsPlayerInAnyVehicle(playerid)) GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
- else
- {
- GetPlayerPos(playerid,x,y,z);
- GetPlayerInterior(playerid);
- }
- if (IsPlayerConnected(giveplayerid))
- {
- if (IsPlayerInAnyVehicle(giveplayerid) && GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
- {
- SetVehiclePos(GetPlayerVehicleID(giveplayerid),x+2,y,z);
- SetPlayerPos(giveplayerid,x+2,y,z);
- PutPlayerInVehicle(giveplayerid,GetPlayerVehicleID(giveplayerid),0);
- }
- else
- SetPlayerPos(giveplayerid,x+2,y,z);
- }
- else
- SendClientMessage(playerid,COLOR_DRED,"Player is not Connected!");
- }
- else
- SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!");
- return 1;
- }
- CMD:goto(playerid,params[])
- {
- if (PlayerInfo[playerid][pAdmin] >=3 || IsPlayerAdmin(playerid))
- {
- new Float:x,Float:y, Float:z;
- new giveplayerid;
- if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_DRED, "SYNTAX: /Get <Playerid>");
- if(IsPlayerInAnyVehicle(giveplayerid)) GetVehiclePos(GetPlayerVehicleID(giveplayerid), x, y, z);
- else
- {
- GetPlayerPos(giveplayerid,x,y,z);
- GetPlayerInterior(giveplayerid);
- }
- if (IsPlayerConnected(giveplayerid))
- {
- if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),x+2,y,z);
- SetPlayerPos(playerid,x+2,y,z);
- PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
- }
- else
- SetPlayerPos(playerid,x+2,y,z);
- }
- else
- SendClientMessage(playerid,COLOR_DRED,"Player is not Connected!");
- }
- else
- SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!");
- return 1;
- }
- CMD:pm(playerid, params[])
- {
- new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
- if(sscanf(params, "us", id, str2))
- {
- SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
- return 1;
- }
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
- {
- GetPlayerName(playerid, Name1, sizeof(Name1));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
- SendClientMessage(playerid, 0xFF0000FF, str);
- format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
- SendClientMessage(id, 0xFF0000FF, str);
- }
- return 1;
- }
- CMD:kill(playerid, params[])
- {
- SetPlayerHealth(playerid,0.0);
- PlayerInfo[playerid][pDeaths]++;
- return 1;
- }
- CMD:a(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) {
- new admin[128];
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- if(PlayerInfo[playerid][pAdmin] == 1) format(admin, sizeof(admin), "[Admin Chat] (Level 1 Admin) %s: %s", Name, params);
- else if(PlayerInfo[playerid][pAdmin] == 2) format(admin, sizeof(admin), "[Admin Chat] (Level 2 Admin) %s: %s", Name, params);
- else if(PlayerInfo[playerid][pAdmin] == 3) format(admin, sizeof(admin), "[Admin Chat] (Level 3 Admin) %s: %s", Name, params);
- else if(PlayerInfo[playerid][pAdmin] == 4) format(admin, sizeof(admin), "[Admin Chat] (Level 4 Admin) %s: %s", Name, params);
- else if(PlayerInfo[playerid][pAdmin] == 5) format(admin, sizeof(admin), "[Admin Chat] (Level 5 Admin) %s: %s", Name, params);
- SendStaffMessage(COLOR_GGREEN, admin);
- }
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) {
- new targetid, reason;
- new VBName[MAX_PLAYER_NAME];
- new VBName1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /kick [playerid] [reason]");
- if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Yourself!");
- if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
- else {
- new str[128];
- format(str, sizeof(str), "Administrator %s Has Kicked %s Reason: %d!", VBName, VBName1, reason);
- SendClientMessageToAll(COLOR_DRED,str);
- Kick(targetid);
- }
- }
- else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
- return 1;
- }
- CMD:setlevel(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid)) {
- new VBName[MAX_PLAYER_NAME];
- new VBName1[MAX_PLAYER_NAME];
- new targetid;
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
- new
- iAdminValue,
- iTargetID;
- if(sscanf(params, "di", iTargetID, iAdminValue)) {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /setlevel [playerid] [level]");
- }
- else if(IsPlayerConnected(iTargetID)) {
- new
- szMessage[47 + (MAX_PLAYER_NAME * 2)];
- if(iAdminValue < 0 || iAdminValue > 4) return SendClientMessage(playerid, COLOR_PURPLE, "Valid range is 0 - 8.");
- PlayerInfo[iTargetID][pAdmin] = iAdminValue;
- format(szMessage, sizeof(szMessage), "Administrator %s has promoted %s to a level %d admin.", VBName, VBName1, iAdminValue);
- SendStaffMessage(COLOR_PURPLE,szMessage);
- format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, VBName);
- SendClientMessage(iTargetID, COLOR_PURPLE, szMessage);
- format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", VBName1,iAdminValue);
- SendClientMessage(playerid, COLOR_PURPLE, szMessage);
- }
- else SendClientMessage(playerid, COLOR_PURPLE, "Invalid player specified.");
- }
- return 1;
- }
- CMD:ip(playerid, params[])
- {
- new giveplayerid;
- new string[128];
- if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
- {
- format(string,sizeof(string),"%s IP: %s",GetPlayerNameEx(giveplayerid),GetPlayerIPEx(giveplayerid));
- SendStaffMessage(COLOR_GGREEN, string);
- }
- else
- SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!");
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 4) {
- new targetid, reason;
- new VBName[MAX_PLAYER_NAME];
- new VBName1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_DRED,"Usage: /Ban [playerid] [reason]");
- if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Ban Yourself!");
- if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
- else {
- new str[128];
- format(str, sizeof(str), "Administrator %s Has Banned %s Reason: %d!", VBName, VBName1, reason);
- SendClientMessageToAll(COLOR_DRED,str);
- Ban(targetid);
- }
- }
- else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
- return 1;
- }
- CMD:banip(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 3) {
- new
- type[ 128 ],
- string[ 128 ]
- ;
- if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "Usage: /banip [IP]");
- else {
- format(string, sizeof(string),"banip %s", type);
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- }
- return true;
- }
- return 1;
- }
- CMD:unbanip(playerid, params[])
- {
- new type[128],string[128];
- new VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "USAGE: /Unbanip [Players IP]");
- else {
- if(PlayerInfo[playerid][pAdmin] >= 3) {
- format(string, sizeof(string),"unbanip %s", type);
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- format(string, sizeof(string), "Administrator: %s has unbanned IP %s", VBName, type);
- SendStaffMessage(-1,string);
- }
- else {
- return SendClientMessage(playerid, -1 ,"You dont have access!");
- }
- }
- return true;
- }
- CMD:clearchat(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_DRED, "ERROR: You must be level 1 to use this command!" );
- {
- new string[128], VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll(COLOR_PURPLE, " " );
- format(string,sizeof(string),"The Server Chat Has Been Cleared By Administrator %s", VBName);
- SendClientMessageToAll(COLOR_DRED, string);
- return 1;
- }
- }
- CMD:givemoney(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 3) {
- new string[128], giveplayerid, money;
- new VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "dd", giveplayerid, money)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /givemoney [playerid] [money]");
- if(IsPlayerConnected(giveplayerid)) {
- GivePlayerMoney(giveplayerid, money);
- format(string, sizeof(string), "[ADMIN] %s has given %s $%d.", VBName, VBName1, money);
- SendStaffMessage(COLOR_DRED, string);
- }
- }
- return 1;
- }
- CMD:pos(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) {
- new Float: pos[3], int;
- if(sscanf(params, "fffd", pos[0], pos[1], pos[2], int)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /pos [x coordinate] [y coordinate] [z coordinate] [interior]");
- SendClientMessage(playerid, COLOR_PURPLE, "You have teleported!");
- SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- SetPlayerInterior(playerid, int);
- }
- return 1;
- }
- CMD:jetpack(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
- new string[128];
- new VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- format(string, sizeof(string), "[ADMIN] %s gave themself a jetpack.", VBName);
- SendStaffMessage(COLOR_DRED, string);
- return 1;
- }
- return 1;
- }
- CMD:setarmour(playerid, params[])
- {
- new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "dd", playa, health)) {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /armour [playerid] [armor]");
- return 1;
- }
- if (PlayerInfo[playerid][pAdmin] >= 3) {
- if(IsPlayerConnected(playa)) {
- if(playa != INVALID_PLAYER_ID) {
- SetPlayerArmour(playa, health);
- format(string, sizeof(string), "[ADMIN] %s set %s's armour to %d.", VBName, VBName1, health);
- SendStaffMessage(COLOR_DRED, string);
- }
- }
- }
- return 1;
- }
- CMD:sethealth(playerid, params[])
- {
- new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "dd", playa, health)) {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /health [playerid] [Health]");
- return 1;
- }
- if (PlayerInfo[playerid][pAdmin] >= 3) {
- if(IsPlayerConnected(playa)) {
- if(playa != INVALID_PLAYER_ID) {
- SetPlayerHealth(playa, health);
- format(string, sizeof(string), "[ADMIN] %s set %s's health to %d.", VBName, VBName1, health);
- SendStaffMessage(COLOR_DRED, string);
- }
- }
- }
- return 1;
- }
- CMD:car(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 2) {
- new
- iVehicle,
- iColors[2];
- if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
- SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /veh [Car ID] [Colour 1] [Colour 2]");
- }
- else if(!(400 <= iVehicle <= 611)) {
- SendClientMessage(playerid, COLOR_PURPLE, "No Such Vehicle Model (400 - 611)");
- }
- else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
- SendClientMessage(playerid, COLOR_PURPLE, "No Such Colour (0 - 255)");
- }
- new
- Float: fVehPos[4];
- GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
- GetPlayerFacingAngle(playerid, fVehPos[3]);
- CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
- return SendClientMessage(playerid, COLOR_PURPLE, "Your Vehicle Has Spawned!");
- }
- return 1;
- }
- CMD:cnn(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) {
- if(!isnull(params)) {
- new
- szMessage[128];
- new VBName [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- format(szMessage, sizeof(szMessage), "~b~%s: ~w~%s",VBName, params);
- foreach(Player, i) GameTextForPlayer(i, szMessage, 5000, 6);
- }
- else SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /cnn [message]. ~n~ = new line, ~r~ = red, ~g~ = green, ~b~ = blue, ~w~ = white, ~y~ = yellow.");
- }
- else SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
- return 1;
- }
- CMD:admins(playerid)
- {
- new string[128];
- SendClientMessage(playerid,COLOR_GGREEN,"---------ONLINE ADMINS---------");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pAdmin] > 0)
- {
- format(string,sizeof(string), "%s - Level %d admin", GetPlayerNameEx(i), PlayerInfo[i][pAdmin]);
- SendClientMessageToAll(COLOR_GGREEN, string);
- }
- }
- return 1;
- }
- CMD:ask(playerid, params[])
- {
- if(isnull(params)) return SendClientMessage(playerid, COLOR_DRED, "USAGE: /ask [Question]");
- new string[120];
- new VBName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- format(string, sizeof(string), "%s Has Asked %s", VBName, params);
- SendStaffMessage(COLOR_ORANGE, string);
- return 1;
- }
- CMD:mute(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 2) {
- new string[128], giveplayerid;
- new VBName [MAX_PLAYER_NAME];
- new VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /mute [playerid]");
- if(IsPlayerConnected(giveplayerid)) {
- if(giveplayerid == playerid) {
- SendClientMessage(playerid, COLOR_PURPLE, "You can not use this command on yourself!");
- return 1;
- }
- if(PlayerInfo[giveplayerid][pMuted] == 0) {
- if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) {
- format(string, sizeof(string), "%s just tried to /mute you.",VBName);
- SendClientMessage(giveplayerid, COLOR_PURPLE, string);
- SendClientMessage(playerid, COLOR_PURPLE, "You can't perform this action on an equal or higher level administrator.");
- return 1;
- }
- PlayerInfo[giveplayerid][pMuted] = 1;
- format(string, sizeof(string), "[ADMIN] %s was silenced by %s.",VBName1,VBName);
- SendStaffMessage(COLOR_PURPLE,string);
- }
- else {
- PlayerInfo[giveplayerid][pMuted] = 0;
- format(string, sizeof(string), "[ADMIN] %s was unsilenced by %s.",VBName1,VBName);
- SendStaffMessage(COLOR_PURPLE,string);
- }
- }
- }
- else {
- SendClientMessage(playerid, COLOR_DRED, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if (PlayerInfo[playerid][pAdmin] >= 2) {
- new string[128], giveplayerid;
- new VBName [MAX_PLAYER_NAME];
- new VBName1 [MAX_PLAYER_NAME];
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /slap [playerid]");
- new Float:shealth;
- new Float:slx, Float:sly, Float:slz;
- if(IsPlayerConnected(giveplayerid)) {
- GetPlayerHealth(giveplayerid, shealth);
- SetPlayerHealth(giveplayerid, shealth-5);
- GetPlayerPos(giveplayerid, slx, sly, slz);
- SetPlayerPos(giveplayerid, slx, sly, slz+5);
- PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
- format(string, sizeof(string), "[ADMIN] %s was slapped by %s",VBName1, VBName);
- SendStaffMessage(COLOR_PURPLE,string);
- }
- }
- else {
- SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
- }
- return 1;
- }
- CMD:ah(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) {
- SendClientMessage(playerid, COLOR_GGREEN,"LEVEL 1 Administrator: /a /kick /freeze /unfreeze /cnn /ip");
- }
- if(PlayerInfo[playerid][pAdmin] >= 2) {
- SendClientMessage(playerid, COLOR_DRED,"LEVEL 2 Administrator: /clearchat /teleports /pos /slap /jetpack");
- }
- if(PlayerInfo[playerid][pAdmin] >= 3) {
- SendClientMessage(playerid, COLOR_DRED,"LEVEL 3 Administrator: /banip /unbanip /givemoney /health /armour /get /goto ");
- }
- if(PlayerInfo[playerid][pAdmin] >= 4) {
- SendClientMessage(playerid, COLOR_DRED,"LEVEL 4 Administrator: /setlevel");
- }
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) {
- new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /freeze [playerid]");
- TogglePlayerControllable(giveplayerid, 0);
- format(string, sizeof(string),"Administrator %s Has Frozen %s", VBName, VBName1);
- SendStaffMessage(COLOR_DRED, string);
- return 1;
- }
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1) {
- new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
- GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
- GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
- if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /unfreeze [playerid]");
- TogglePlayerControllable(giveplayerid, 1);
- format(string, sizeof(string),"Administrator %s Has Unfrozen %s", VBName, VBName1);
- SendStaffMessage(COLOR_DRED, string);
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if (dialogid == 1)
- {
- new name[MAX_PLAYER_NAME], file[256], string[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- if(!response) return Kick(playerid);
- if (!strlen(inputtext)) return
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Your account is not registered", "Password:", "Register", "Leave");
- dini_Create(file);
- dini_IntSet(file, "Password", udb_hash(inputtext));
- dini_IntSet(file, "Admin",PlayerInfo[playerid][pAdmin] = 0);
- dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
- dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
- dini_IntSet(file, "Kills",PlayerInfo[playerid][pKills] = 0);
- dini_IntSet(file, "Deaths",PlayerInfo[playerid][pDeaths] = 0);
- dini_IntSet(file, "Muted",PlayerInfo[playerid][pMuted] = 0);
- format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s, you have been auto logged in.", name, inputtext);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- gPlayerLogged[playerid] = 1;
- }
- if (dialogid == 2)
- {
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- if(!response) return Kick(playerid);
- if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account is Registered", "Password:", "Login", "Leave");
- new tmp;
- tmp = dini_Int(file, "Password");
- if(udb_hash(inputtext) != tmp) {
- SendClientMessage(playerid,COLOR_RED, "Wrong Password.");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account is Registered", "Password", "Login", "Leave");
- }
- else
- {
- gPlayerLogged[playerid] = 1;
- PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
- PlayerInfo[playerid][pKills] = dini_Int(file, "Kills");
- PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths");
- PlayerInfo[playerid][pMuted] = dini_Int(file, "Muted");
- SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
- GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
- SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: Successfully logged in!");
- }
- }
- }
- SetPlayerTeamFromClass(playerid, classid)
- {
- ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0,0,0,0,0,0);
- if (classid == 0 ||classid == 1 ||classid == 2 ||classid == 3)
- {
- gTeam[playerid] = TEAM_GROVE;
- }
- else if(classid == 4 ||classid == 5 ||classid == 6)
- {
- gTeam[playerid] = TEAM_AZTECAS;
- }
- else if(classid == 7 ||classid == 8 ||classid == 9)
- {
- gTeam[playerid] = TEAM_COPS;
- }
- else if(classid == 10 ||classid == 11 ||classid == 12 ||classid == 13)
- {
- gTeam[playerid] = TEAM_BALLAS;
- }
- else if(classid == 14 ||classid == 15 ||classid == 16)
- {
- gTeam[playerid] = TEAM_VAGOS;
- }
- else if(classid == 17 ||classid == 18 ||classid == 19)
- {
- gTeam[playerid] = TEAM_BIKERS;
- }
- else if(classid == 20 ||classid == 21)
- {
- gTeam[playerid] = TEAM_SKATERS;
- }
- else if(classid == 22 ||classid == 23 ||classid == 24 ||classid == 25)
- {
- gTeam[playerid] = TEAM_RED;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment