Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*---------------------------------INCLUDES-----------------------------------*/
- #include <a_samp>
- #include <sscanf2>
- #include <dini>
- #include <dutils>
- #include <zcmd>
- /*---------------------------------PRAGMAS------------------------------------*/
- #pragma unused ret_memcpy
- /*---------------------------------DEFINES------------------------------------*/
- #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- #define COLOR_RED 0xFF0000C8
- #define COLOR_YELLOW 0xDFF709C8
- #define COLOR_GREEN 0x09F709C8
- #define COLOR_LIGHTBLUE 0x44BBBBC8
- #define COLOR_BLUE 0x0000FFC8
- #define COLOR_PINK 0xBB4497C8
- #define COLOR_PURPLE 0xAF09F7C8
- #define COLOR_YELLOWGREEN 0x80EA15C8
- #define COLOR_GREY 0x847B7BC8
- #define COLOR_WHITE 0xFFFFFFC8
- #define COLOR_ORANGE 0xFF8000C8
- #define COLOR_BLACK 0x000000C8
- #define REGISTER_DIALOG 0
- #define LOGIN_DIALOG 1
- #define PlayerFile "Admin/Users/%s.ini"
- #define CommandFile "Admin/Settings/Commands.ini"
- /*----------------------------------------------------------------------------*/
- main()
- {
- print("\n----------------------------------");
- print(" TeamDeathMatch by [TDM]the_boss ");
- print("----------------------------------\n");
- }
- /*----------------------------------------------------------------------------*/
- new String[128], Float:SpecX[MAX_PLAYERS], Float:SpecY[MAX_PLAYERS], Float:SpecZ[MAX_PLAYERS], vWorld[MAX_PLAYERS], Inter[MAX_PLAYERS];
- new IsSpecing[MAX_PLAYERS], Name[MAX_PLAYER_NAME], IsBeingSpeced[MAX_PLAYERS],spectatorid[MAX_PLAYERS];
- forward ReportLog(string[]);
- enum PLAYER_MAIN
- {
- PLAYER_NAME[MAX_PLAYER_NAME],
- PLAYER_IP[16],
- PLAYER_REGGED,
- PLAYER_PASS,
- PLAYER_LEVEL,
- PLAYER_MONEY,
- PLAYER_SCORE,
- }
- new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
- new gPlayerLogged[MAX_PLAYERS];
- enum COMMANDS_MAIN
- {
- KICK,
- BAN
- }
- new gCommands[COMMANDS_MAIN];
- public OnFilterScriptInit()
- {
- // Level 0 = Normal Player
- // Level 1 = Trail Moderator
- // Level 2 = Moderator
- // Level 3 = Administrator
- // Level 4 = Head Administrator
- // Level 5 = Server owner
- if(!fexist(CommandFile))
- {
- dini_Create(CommandFile);
- dini_IntSet(CommandFile, "Kick", 2);
- dini_IntSet(CommandFile, "Ban", 3);
- }
- gCommands[KICK] = dini_Int(CommandFile, "Kick");
- gCommands[BAN] = dini_Int(CommandFile, "Ban");
- return 1;
- }
- public ReportLog(string[])
- {
- new entry[128];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("Admin/Reports/Reports.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- }
- forward BanLog(string[]);
- public BanLog(string[])
- {
- new entry[129];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("Admin/Bans/Bans.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- forward KickLog(string[]);
- public KickLog(string[])
- {
- new entry[130];
- format(entry, sizeof(entry), "%s\n",string);
- new File:hFile;
- hFile = fopen("Admin/Kicks/Kicks.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- stock GetName(playerid)
- {
- new
- name[24];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- stock PlayerName(playerid)
- {
- new pname[24];
- GetPlayerName(playerid, pname, 24);
- return pname;
- }
- stock PlayerIp(playerid)
- {
- new pip[24];
- GetPlayerIp(playerid, pip, 24);
- return pip;
- }
- public OnGameModeInit()
- {
- SetGameModeText("*TeamDeathMatch*");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new pname[24];
- GetPlayerName(playerid, pname,24);
- new string[128];
- format(string,128,"*[JOIN]: %s has joined Team_Death_Match server.*",pname);
- SendClientMessageToAll(COLOR_GREEN ,string);
- new file[100], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), PlayerFile, name);
- if(!fexist(file))
- {
- ShowPlayerDialog(playerid, REGISTER_DIALOG, DIALOG_STYLE_INPUT, "Register", "Welcome! This account is not registered.\nEnter your new password below to create a new account.", "Register", "Exit");
- }
- else if(fexist(file))
- {
- ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_INPUT, "Login", "Welcome back! This account is registered. \nInsert your password below to login.", "Login", "Exit");
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new file[100],name[24]; GetPlayerName(playerid, name, 24);
- format(file, sizeof(file), PlayerFile, name);
- dini_Set(file, "Name", PlayerName(playerid));
- dini_Set(file, "Ip", PlayerIp(playerid));
- dini_IntSet(file, "Registered", gPlayerInfo[playerid][PLAYER_REGGED]);
- dini_IntSet(file, "Password", gPlayerInfo[playerid][PLAYER_PASS]);
- dini_IntSet(file, "Level", gPlayerInfo[playerid][PLAYER_LEVEL]);
- dini_IntSet(file, "Money", GetPlayerMoney(playerid));
- dini_IntSet(file, "Score", GetPlayerScore(playerid));
- gPlayerLogged[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(GetPlayerScore(playerid) >= 10)
- {
- new Text3D:label = Create3DTextLabel("Newbie",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.4);
- }
- else if(GetPlayerScore(playerid) >= 50)
- {
- new Text3D:label1 = Create3DTextLabel("Private",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label1, playerid, 0.0, 0.0, 0.4);
- }
- else if(GetPlayerScore(playerid) >= 100)
- {
- new Text3D:label2 = Create3DTextLabel("Soldier",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label2, playerid, 0.0, 0.0, 0.4);
- }
- else if(GetPlayerScore(playerid) >= 300)
- {
- new Text3D:label3 = Create3DTextLabel("Capitan",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label3, playerid, 0.0, 0.0, 0.4);
- }
- else if(GetPlayerScore(playerid) >= 500)
- {
- new Text3D:label4 = Create3DTextLabel("General Of Army",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label4, playerid, 0.0, 0.0, 0.4);
- }
- else if(GetPlayerScore(playerid) >= 1000)
- {
- new Text3D:label5 = Create3DTextLabel("Destroyer",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label5, playerid, 0.0, 0.0, 0.4);
- }
- else if(GetPlayerScore(playerid) >= 3000 && GetPlayerScore(playerid) < 600)
- {
- new Text3D:label6 = Create3DTextLabel("Profesional",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label6, playerid, 0.0, 0.0, 0.4);
- }
- else if(GetPlayerScore(playerid) >= 5000)
- {
- new Text3D:label3 = Create3DTextLabel("GOD",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label3, playerid, 0.0, 0.0, 0.4);
- }
- 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("/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[])
- {
- if(dialogid == 1)
- {
- if(response)
- {
- if(strlen(inputtext))
- {
- new file[100], name[MAX_PLAYER_NAME], ip[16], string[128];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerIp(playerid, ip, sizeof(ip));
- format(file, sizeof(file), PlayerFile, name);
- dini_Create(file);
- dini_Set(file, "Name", name);
- dini_Set(file, "Ip", ip);
- dini_IntSet(file, "Registered", 1);
- dini_IntSet(file, "Password", num_hash(inputtext));
- dini_IntSet(file, "Level", 0);
- dini_IntSet(file, "Money", 1000);
- dini_IntSet(file, "Score", 0);
- format(string, sizeof(string), "INFO: You have been succesfully registered %s!", name);
- SendClientMessage(playerid ,COLOR_GREEN ,string);
- strcat(gPlayerInfo[playerid][PLAYER_NAME], dini_Get(file, "Name"));
- strcat(gPlayerInfo[playerid][PLAYER_IP], dini_Get(file, "Ip"));
- gPlayerInfo[playerid][PLAYER_PASS] = dini_Int(file, "Password");
- gPlayerInfo[playerid][PLAYER_LEVEL] = dini_Int(file, "Level");
- dini_IntSet(file,"Money",GetPlayerMoney(playerid));
- dini_IntSet(file,"Score",GetPlayerScore(playerid));
- gPlayerLogged[playerid] = 1;
- }
- else if(!strlen(inputtext))
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You must type in a password!");
- ShowPlayerDialog(playerid, REGISTER_DIALOG, DIALOG_STYLE_INPUT, "Register", "This account is registered. \nInsert your password below to login to your account.", "Register", "Exit");
- }
- }
- else if(!response)
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You need to register in order to play!");
- Kick(playerid);
- }
- }
- if(dialogid == 2)
- {
- if(response)
- {
- if(strlen(inputtext))
- {
- new file[100], name[MAX_PLAYER_NAME], string[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), PlayerFile, name);
- if(num_hash(inputtext) == dini_Int(file, "Password"))
- {
- strcat(gPlayerInfo[playerid][PLAYER_NAME], dini_Get(file, "Name"));
- strcat(gPlayerInfo[playerid][PLAYER_IP], dini_Get(file, "Ip"));
- gPlayerInfo[playerid][PLAYER_PASS] = dini_Int(file, "Password");
- gPlayerInfo[playerid][PLAYER_LEVEL] = dini_Int(file, "Level");
- GivePlayerMoney(playerid, dini_Int(file, "Money"));
- SetPlayerScore(playerid, dini_Int(file, "Score"));
- gPlayerLogged[playerid] = 1;
- format(string, sizeof(string), "INFO: Welcome back, %s!", name);
- SendClientMessage(playerid, COLOR_GREEN, string);
- }
- else if(num_hash(inputtext) != dini_Int(file, "Password"))
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: Wrong password!");
- ShowPlayerDialog(playerid, LOGIN_DIALOG, DIALOG_STYLE_INPUT, "Login", "Please fill in your password!", "Login", "Exit");
- }
- }
- else if(!strlen(inputtext))
- {
- SendClientMessage(playerid, COLOR_RED, "SERVER: You must fill in your password!");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", " Please fill in your password!", "Login", "Exit");
- }
- }
- else if(!response)
- {
- SendClientMessage(playerid, COLOR_RED, "ERROR: You need to login in order to play!");
- Kick(playerid);
- }
- }
- return 0;
- }
- /*-----------------------------------COMMANDS---------------------------------*/
- CMD:kick(playerid, params[])
- {
- new playerb, string[128],reason[128];
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- if(sscanf(params, "us[128]", playerb, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /kick [playerid] [reason]");
- if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected.");
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[playerid][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_YELLOW, "WARNING: This Player has a higher admin level than you.");
- new nameb[24],name2[24]; GetPlayerName(playerid, nameb, 24); GetPlayerName(playerb, name2,24);
- format(string, sizeof(string), "[KICK]: %s has been kicked by %s, reason: %s", name2, nameb, params);
- SendClientMessageToAll(COLOR_YELLOW, string);
- KickLog(string);
- Kick(playerb);
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- new id, reason[50], string[128], banned[MAX_PLAYER_NAME];
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this command!");
- if(sscanf(params, "us[50]", id, reason)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /ban [playerid] [reason]");
- GetPlayerName(id, banned, sizeof(banned)); new pname[24]; GetPlayerName(playerid, pname, 24);
- format(string, sizeof(string), "[BAN]: %s has been banned by %s. reason: %s", banned, pname, reason);
- SendClientMessageToAll(COLOR_YELLOW, string);
- BanLog(string);
- BanEx(id, reason);
- return 1;
- }
- CMD:getip(playerid, params[])
- {
- new id;
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to use this command!");
- if(sscanf(params,"i",id)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /getip [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected.");
- new string[128],ip[24],pname[24];
- GetPlayerIp(id, ip, 24); GetPlayerName(id, pname, 24);
- format(string,128,"[GetIP]: %s's IP is: %s",pname,ip);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- return 1;
- }
- CMD:announce(playerid,params[])
- {
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1)return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- new text[60];
- if(sscanf(params,"s[60]",text))
- return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /announce [text]");
- GameTextForAll(text,3000,3);
- return 1;
- }
- CMD:cchat(playerid,params[])
- {
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2)return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- {
- for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll( COLOR_WHITE, "" );
- }
- return 1;
- }
- CMD:explode(playerid, params[])
- {
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3)return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- new string[128], ID, Float:x, Float:y, Float:z;
- if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_ORANGE, "Usage: /explode [playerid/name]");
- else if(!IsPlayerConnected(ID)) SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected.");
- else
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(ID, pName, MAX_PLAYER_NAME);
- GetPlayerPos(ID, x, y, z);
- CreateExplosion(x, y, z, 12, 10.0);
- format(string,sizeof(string), "You have exploded %s[ID: %d].", pName, ID);
- SendClientMessage(playerid, COLOR_PURPLE, string);
- }
- return 1;
- }
- CMD:unbanip(playerid, params[])
- {
- new type[128],string[128];
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4)return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- else if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, COLOR_ORANGE, "Usage: /unbanip [Players IP]");
- else
- {
- new string2[128];
- format(string, sizeof(string),"unbanip %s", type);
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- format(string2, sizeof(string2), "[UNBAN]: You have successfully unbanned IP.");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string2);
- }
- return 1;
- }
- CMD:report(playerid,params[]) {
- new
- name1[30],
- name2[30],
- id,
- text[128],
- reason[50];
- if(sscanf(params,"us",id,reason))
- return SendClientMessage(playerid, COLOR_ORANGE,"Usage: /report [id] [reason]");
- if(IsPlayerConnected(id)) {
- SendClientMessage(playerid,COLOR_GREEN,"Your report have been sent to online administartor. Thank you for reporting.");
- for(new i = 0; i < MAX_PLAYERS; ++i) {
- if(IsPlayerConnected(i) && !IsPlayerNPC(i) && gPlayerInfo[i][PLAYER_LEVEL] > 0) {
- GetPlayerName(playerid,name1,sizeof(name1));
- GetPlayerName(id,name2,sizeof(name2));
- new Hour,Minute,Second;
- gettime(Hour,Minute,Second);
- format(text,sizeof(text),"|| %d:%d:%d || [Report] | \"%s\" [%i] has reported \"%s\" [%i], reason: %s.",Hour,Minute,Second,name1,playerid,name2,id,reason);
- SendClientMessage(i,COLOR_YELLOW,text);
- ReportLog(text);
- }
- }
- } else {
- return SendClientMessage(playerid,COLOR_RED,"ERROR: This player is not connected.");
- }
- return 1;
- }
- CMD:makeadmin(playerid, params[])
- {
- new id,
- level;
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 5)
- return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- if(sscanf(params, "ui", id, level))
- return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /makeadmin [playerid] [level]");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected!");
- if ( level < 0 || level > 5 )
- return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Admin level (1-5)!");
- gPlayerInfo[id][PLAYER_LEVEL] = level;
- new pName[MAX_PLAYER_NAME], str[128], pName1[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- GetPlayerName(id, pName1, sizeof(pName1));
- format(str, sizeof(str), "[SYSTEM]: Administrator %s has changed %s's Admin level to %i",pName, pName1, level);
- SendClientMessageToAll(COLOR_YELLOW, str);
- new file[100];
- format(file, sizeof(file), PlayerFile, gPlayerInfo[playerid][PLAYER_NAME]);
- dini_Set(file, "Name", gPlayerInfo[playerid][PLAYER_NAME]);
- dini_Set(file, "Ip", gPlayerInfo[playerid][PLAYER_IP]);
- dini_IntSet(file, "Registered", gPlayerInfo[playerid][PLAYER_REGGED]);
- dini_IntSet(file, "Password", gPlayerInfo[playerid][PLAYER_PASS]);
- dini_IntSet(file, "Level", gPlayerInfo[playerid][PLAYER_LEVEL]);
- dini_IntSet(file, "Money", GetPlayerMoney(playerid));
- gPlayerLogged[playerid] = 0;
- return 1;
- }
- CMD:setscore(playerid, params[])
- {
- new targetid, score, sendername[MAX_PLAYER_NAME], receivername[MAX_PLAYER_NAME], string[128];
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- if(sscanf(params,"ui", targetid, score)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /setscore [PlayerID] [Score]");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This Player is not Connected!");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(targetid, receivername,sizeof(receivername));
- format(string, sizeof(string),"[SCORE]: Your Score been setted to %d by an admin %s", score, sendername);
- SendClientMessage(targetid, COLOR_YELLOW, string);
- format(string, sizeof(string),"[SCORE]: Admin %s Setted your score to %d", receivername, score);
- SendClientMessage(targetid, COLOR_YELLOW, string);
- SetPlayerScore(playerid, score);
- return 1;
- }
- CMD:spec(playerid, params[])
- {
- new id;
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- if(sscanf(params,"u", id))return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /spec [playerid]");
- if(id == playerid)return SendClientMessage(playerid,COLOR_RED,"ERROR: You cannot spec yourself.");
- if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected");
- if(IsSpecing[playerid] == 1)return SendClientMessage(playerid,COLOR_YELLOW,"WARNING: You are already specing someone.");
- GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
- Inter[playerid] = GetPlayerInterior(playerid);
- vWorld[playerid] = GetPlayerVirtualWorld(playerid);
- TogglePlayerSpectating(playerid, true);
- if(IsPlayerInAnyVehicle(id))
- {
- if(GetPlayerInterior(id) > 0)
- {
- SetPlayerInterior(playerid,GetPlayerInterior(id));
- }
- if(GetPlayerVirtualWorld(id) > 0)
- {
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
- }
- PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));
- }
- else
- {
- if(GetPlayerInterior(id) > 0)
- {
- SetPlayerInterior(playerid,GetPlayerInterior(id));
- }
- if(GetPlayerVirtualWorld(id) > 0)
- {
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
- }
- PlayerSpectatePlayer(playerid,id);
- }
- GetPlayerName(id, Name, sizeof(Name));
- format(String, sizeof(String),"You have started to spectate %s.",Name);
- SendClientMessage(playerid,0x0080C0FF,String);
- IsSpecing[playerid] = 1;
- IsBeingSpeced[id] = 1;
- spectatorid[playerid] = id;
- return 1;
- }
- CMD:specoff(playerid, params[])
- {
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- if(IsSpecing[playerid] == 0)return SendClientMessage(playerid,COLOR_RED,"ERROR: You are not spectating anyone.");
- TogglePlayerSpectating(playerid, 0);
- return 1;
- }
- CMD:heal(playerid, params[])
- {
- new hp;
- new destid;
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- if(!IsPlayerConnected(destid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This Player is not Connected!");
- if(sscanf(params,"ud",destid,hp)) return SendClientMessage(playerid, COLOR_ORANGE,"Usage: /heal [playerid] [ammount]");
- SetPlayerHealth(destid,hp);
- SendClientMessageToAll(playerid, "{AF09F7}[System]: Admin has healed a player.");
- return 1;
- }
- CMD:akill(playerid, params[])
- {
- new destid;
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- if(!IsPlayerConnected(destid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This Player is not Connected!");
- if(sscanf(params,"ud",destid)) return SendClientMessage(playerid, COLOR_ORANGE,"Usage: /akill [playerid]");
- SetPlayerHealth(destid, 0);
- SendClientMessage(playerid, COLOR_YELLOW, "[System]: You have a-killed a player!");
- return 1;
- }
- CMD:get(playerid, params[])
- {
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- new id, string [120];
- if(sscanf(params, "r", id)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /get [playerid]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: This player is not connected.");
- new Float:Pos[4], playeridname[MAX_PLAYER_NAME+1], idname[MAX_PLAYER_NAME+1];
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- GetPlayerPos(id, Pos[0], Pos[1], Pos[2]);
- GetPlayerFacingAngle(id, Pos[3]);
- SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerFacingAngle(playerid, Pos[3]);
- GetPlayerName(id, idname, sizeof(idname));
- GetPlayerName(playerid, playeridname, sizeof(playeridname));
- format(string, sizeof(string), "[System]: Administrator %s has teleported %s to him.", playeridname, idname);
- SendClientMessageToAll(COLOR_PURPLE, string);
- return 1;
- }
- CMD:rankinfo(playerid,params[])
- {
- SendClientMessage(playerid, COLOR_GREEN, "***[TDM] Ranks***");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Newbie 0-10*");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Private 11-50*");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Soldier 51-100*");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Capitan 101-300*");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*General Of Army 301-500*");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Destroyer 501-1000*");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*Profesional 1001-3000*");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "*GOD 3001-5000...*");
- return 1;
- }
- CMD:givemoney(playerid, params[])
- {
- if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "You are not allowed to use this command!");
- {
- new string[128], targetid, money;
- if(sscanf(params, "ud", targetid, money)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /givemoney [playerid] [money]");
- if(IsPlayerConnected(targetid))
- {
- GivePlayerMoney(targetid, money);
- format(string, sizeof(string), "[System]: You have set %s's cash to an amount of $%d.",GetName(targetid),money);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment