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
- #include <a_samp>
- #include sscanf2
- #include <dini>
- #include <zcmd>
- #include <SII>
- #include <dudb>
- #include <foreach>
- #pragma unused ret_memcpy
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- #define COLOR_GREY 0x778899FF
- #define COLOR_RED 0xCC3300FF
- #define COLOR_LIGHTBLUE 0x87CEFAFF
- #define GREY 0xAFAFAFAA
- #define GREEN 0x33AA33AA
- #define YELLOW 0xFFFF00AA
- #define WHITE 0xFFFFFFAA
- #define LIGHTBLUE 0x33CCFFAA
- #define ORANGE 0xFF9900AA
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 32 // Here you need to set the maximum number of players able to play on your server at any given time, I'll put 32 because that's the max players on my server.
- #define Grey 0xC0C0C0FF // Defining the color 'Grey'
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_LIME 0x10F441AA
- #define CANT_USE_CMD "You are not allowed to use this command!"
- #define PLAYER_NOT_FOUND "Player not found!"
- #define COLOR_DRED 0xFF0000AA //defines red color
- new aDuty[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- enum PlayerInfo
- {
- Logged,
- Level,
- Frozen,
- pPass,
- pCash,
- AdminLevel,
- pAdminDuty,
- }
- new PInfo[MAX_PLAYERS][PlayerInfo];
- 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];
- new Muted[MAX_PLAYERS];
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- 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 file[64],PlayerName[25];//Creating a variable where we can store the file path, and the variable to store the player's name.
- GetPlayerName(playerid,PlayerName,sizeof PlayerName);//Storing the players name in the PlayerName variable.
- format(file,sizeof file,"Admin/%s.ini",PlayerName);//Storing the file path with the players name.
- if(!fexist(file))//Checking if the file exists
- {
- SendClientMessage(playerid,-4,"Your account its not registred! Please use /register <password> to register one");
- }
- else
- {
- SendClientMessage(playerid,-4,"Your account its already registred!Please Use /login <password> to login into your account");
- }
- aDuty[playerid] = 0; //Set player off duty when connects
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(IsBeingSpeced[playerid] == 1)//If the player being spectated, disconnects, then turn off the spec mode for the spectator.
- {
- foreach(Player,i)
- {
- if(spectatorid[i] == playerid)
- {
- TogglePlayerSpectating(i,false);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
- }
- }
- }
- PInfo[playerid][Logged] = 0;
- aDuty[playerid] = 0; //set player off duty when disconnects
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(IsSpecing[playerid] == 1)
- {
- SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// Remember earlier we stored the positions in these variables, now we're gonna get them from the variables.
- SetPlayerInterior(playerid,Inter[playerid]);//Setting the player's interior to when they typed '/spec'
- SetPlayerVirtualWorld(playerid,vWorld[playerid]);//Setting the player's virtual world to when they typed '/spec'
- IsSpecing[playerid] = 0;//Just saying you're free to use '/spec' again YAY :D
- IsBeingSpeced[spectatorid[playerid]] = 0;//Just saying that the player who was being spectated, is not free from your stalking >:D
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(IsBeingSpeced[playerid] == 1)//If the player being spectated, dies, then turn off the spec mode for the spectator.
- {
- foreach(Player,i)
- {
- if(spectatorid[i] == playerid)
- {
- TogglePlayerSpectating(i,false);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
- }
- }
- }
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(Muted[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF, "You Have Been Muted And Cannot Speak!");
- //Code continues...
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)// If the player's state changes to a vehicle state we'll have to spec the vehicle.
- {
- if(IsBeingSpeced[playerid] == 1)//If the player being spectated, enters a vehicle, then let the spectator spectate the vehicle.
- {
- foreach(Player,i)
- {
- if(spectatorid[i] == playerid)
- {
- PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));// Letting the spectator, spectate the vehicle of the player being spectated (I hope you understand this xD)
- }
- }
- }
- }
- if(newstate == PLAYER_STATE_ONFOOT)
- {
- if(IsBeingSpeced[playerid] == 1)//If the player being spectated, exists a vehicle, then let the spectator spectate the player.
- {
- foreach(Player,i)
- {
- if(spectatorid[i] == playerid)
- {
- PlayerSpectatePlayer(i, playerid);// Letting the spectator, spectate the player who exited the vehicle.
- }
- }
- }
- }
- 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)//This is called when a player's interior is changed.
- {
- if(IsBeingSpeced[playerid] == 1)//If the player being spectated, changes an interior, then update the interior and virtualword for the spectator.
- {
- foreach(Player,i)
- {
- if(spectatorid[i] == playerid)
- {
- SetPlayerInterior(i,GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
- }
- }
- }
- 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)
- {
- return 1;
- }
- COMMAND:register(playerid,params[])
- {
- if(PInfo[playerid] [Logged] == 1) return SendClientMessage(playerid,-4,"You are already logged in !");//checks if player its logged or not
- new password[23];//Creates a variable to store passowrds
- if(sscanf(params,"s[23]",password)) return SendClientMessage(playerid,-1,"USAGE:/Register <passowrd>");// this will check if player wrote something or no
- new file[64],PlayerName[24];// creates/stores player names
- GetPlayerName(playerid,PlayerName,sizeof PlayerName);
- format(file,sizeof file,"Admin/%s.ini",PlayerName);
- if(fexist(file)) return SendClientMessage(playerid,-4,"Somehow you're already registered!");//Checking if the player is already registered, again....
- INI_Open(file);//Opening the file with SII include (with this function, if the file is not created, it will automatically create the file.)
- INI_WriteString("Password",password);//Writing in the file the password the player has inputted.
- INI_WriteInt("Level",PInfo[playerid][Level]);//Writing in the file, the variable of the admin level.
- INI_Save();//After we write something to the file, we already have to use this to save the information in the player's file.
- INI_Close();//"Closing the file", that means that we're not using it anymore :P
- SendClientMessage(playerid,-1,"You have successfully registered!");
- PInfo[playerid][Logged] = 1;//Setting the logged in variable to 1
- return 1;
- }
- COMMAND:login(playerid,params[])
- {
- if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,-4,"You are already logged in!");//Checking if the player is logged in, if he is, it won't allow him to login
- new password[23],password2[23];//Creating a variable to store the password, and another one to store the password from the user's file.
- if(sscanf(params,"s[23]",password)) return SendClientMessage(playerid,-1,"USAGE: /login <password>");//Here we're checking if the player inputs any password, if not, it will return to him a message saying the proper usage.
- new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
- GetPlayerName(playerid,PlayerName,sizeof PlayerName);
- format(file,sizeof file,"Admin/%s.ini",PlayerName);
- if(!fexist(file)) return SendClientMessage(playerid,-4,"Please use /register");//Checking if the player is not registered, again....
- INI_Open(file);//Opening the file with SII include
- INI_ReadString(password2,"Password");
- if(strcmp(password,password2) != 0) return SendClientMessage(playerid,-4,"Wrong password!"),INI_Close();//Checking if he inputted the correct password, if not, retrieve him a message and closing the file;
- PInfo[playerid][Level] = INI_ReadInt("Level");//Setting the admin level variable, to the one thats in his file.
- INI_Close();//"Closing the file", that means that we're not using it anymore :P
- SendClientMessage(playerid,-1,"You have been successfully logged in!");
- PInfo[playerid][Logged] = 1;//Setting the logged in variable to 1
- return 1;
- }
- COMMAND:kick(playerid, params[])
- {
- if(PInfo[playerid][Level] >= 1) {
- new PID; //define the playerid we wanna kick
- new reason[64]; //the reason, put into a string
- new str[128]; //a new message string
- new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
- GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
- GetPlayerName(PID, Playername, sizeof(Playername));
- if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
- if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
- return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
- SendClientMessageToAll(COLOR_RED, str); //send that message to all
- Kick(PID); //kick the playerid we've defined
- }
- else //if he has not got the permissions
- {
- SendClientMessage(playerid, COLOR_GREY, "You Have To Be Admin Level 1 To Kick Some One!"); //return this message
- }
- return 1;
- }
- COMMAND:ban(playerid, params[])
- {
- if(PInfo[playerid][Level] >= 1) {
- new PID; //define the playerid we wanna ban
- new reason[64]; //the reason, put into a string
- new str[128]; //a new message string
- new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
- GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
- GetPlayerName(PID, Playername, sizeof(Playername));
- if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
- if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
- return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
- format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
- SendClientMessageToAll(COLOR_RED, str); //send that message to all
- Ban(PID); //Ban the playerid we've defined
- }
- else //if he has not got the permissions
- {
- SendClientMessage(playerid, COLOR_GREY, "You have to be level 1 to use that command!"); //return this message
- }
- return 1;
- }
- COMMAND:freeze(playerid,params[])
- {
- if(PInfo[playerid][Level] >= 1)
- {
- new Target; //defines the playerid we wanna freeze
- if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_RED, "USAGE: /freeze [playerid]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
- if(!IsPlayerConnected(Target)) //if the ID doesn't exist, return an error-message
- return SendClientMessage(playerid, COLOR_GREY, "ERROR:Player is not connected!");
- if(!sscanf(params, "u", Target))
- {
- if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR: Cant perform this command on yourself!" ); //I wouldn't add this line, because it won't let you perform this CMD on yourself
- if(PInfo[Target][Level] > PInfo[playerid][Level]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You cant perform this on Admins that are higher than your level!"); // if the player you're performing this command on has a higher level as you, return a message, you ain't able to freeze him
- new tname[MAX_PLAYER_NAME]; //define the new target-name of the playerid
- GetPlayerName(Target,tname,sizeof(tname)); //get the playername with this function
- new pname[MAX_PLAYER_NAME]; //define the adminname
- GetPlayerName(playerid,pname,sizeof(pname)); //get the adminname with this function
- new tstring[128]; //define the string for the player (victim)
- new pstring[128];// define the string for the admin which is performing
- new astring[128];//define the string for all the players which are online
- format(tstring,sizeof(tstring),"You have been frozen by administrator %s! You cant move!",pname); //this is formatting the player-string, while it's also getting the adminname
- format(pstring,sizeof(pstring),"You have frozen player %s(%d)!",tname,Target); //this is formatting the adminname-string, while it's also getting the playername and his ID(target)
- format(astring,sizeof(astring),"Administrator %s has frozen %s!",pname,tname); //this is formatting the all-string, while it's sending this message to everybody and is getting admin- and playername
- SendClientMessage(Target,COLOR_RED,tstring);//sends the message to the victim
- SendClientMessage(playerid,COLOR_RED,pstring);//sends the message to the admin
- SendClientMessageToAll(COLOR_RED,astring);//sends the message to everybody
- TogglePlayerControllable(Target,0); //with that function, the player won't be able to mov, while we're using the variable "Target" as the playerid
- PInfo[Target][Frozen] = 1;//IMPORTANT:we're getting the variable "[frozen]" out of the enum, and set it's value to "1', the compiler knows now that the player is frozen
- }
- }
- // if he doesn't have permissions, return that message!
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be level 1 to use this command!");
- return 1;
- }
- COMMAND:unfreeze(playerid,params[])
- {
- if(PInfo[playerid][Level] >= 1)
- {
- new Target; //defines the playerid we wanna unfreeze
- if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unfreeze [playerid]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
- if(!IsPlayerConnected(Target)) //if the ID doesn't exist, return an error-message
- return SendClientMessage(playerid, COLOR_GREY, "ERROR:Player is not connected!");
- if(!sscanf(params, "u", Target))
- {
- if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR: Cant perform this command on yourself!" ); //I wouldn't add this line, because it won't let you perform this CMD on yourself
- if(PInfo[Target][Level] > PInfo[playerid][Level]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You cant perform this on Admins that are higher than your level!"); // if the player you're performing this command on has a higher level as you, return a message, you ain't able to unfreeze him
- new tname[MAX_PLAYER_NAME]; //define the new target-name of the playerid
- GetPlayerName(Target,tname,sizeof(tname)); //get the playername with this function
- new pname[MAX_PLAYER_NAME]; //define the adminname
- GetPlayerName(playerid,pname,sizeof(pname)); //get the adminname with this function
- new tstring[128]; //define the string for the player (victim)
- new pstring[128];// define the string for the admin which is performing
- new astring[128];//define the string for all the players which are online
- format(tstring,sizeof(tstring),"You have been unfrozen by administrator %s! You cant move!",pname); //this is formatting the player-string, while it's also getting the adminname
- format(pstring,sizeof(pstring),"You have unfrozen player %s(%d)!",tname,Target); //this is formatting the adminname-string, while it's also getting the playername and his ID(target)
- format(astring,sizeof(astring),"Administrator %s has unfrozen %s!",pname,tname); //this is formatting the all-string, while it's sending this message to everybody and is getting admin- and playername
- SendClientMessage(Target,COLOR_RED,tstring);//sends the message to the victim
- SendClientMessage(playerid,COLOR_RED,pstring);//sends the message to the admin
- SendClientMessageToAll(COLOR_LIGHTBLUE,astring);//sends the message to everybody
- TogglePlayerControllable(Target,1); //with that function, the player will be able to move again, while we're using the variable "Target" as playerid again
- PInfo[Target][Frozen] = 0;//IMPORTANT:we're getting the variable "[frozen]" out of the enum, and set it's value to "0", the compiler knows now that the player is unfrozen
- }
- }
- // if he doesn't have permissions, return that message!
- else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be level 1 to use this command!");
- return 1;
- }
- COMMAND:clearchat(playerid,params[])
- {
- if( PInfo[ playerid ][ Level ] < 1 ) return SendClientMessage( playerid, COLOR_RED, "ERROR: You must be level 1 to use this command!" );
- {
- for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll( COLOR_LIGHTBLUE, "" );
- }
- return 1;
- }
- COMMAND:setlevel(playerid,params[])
- {
- new level,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls
- new tmp[256], tmp2[256], Index,str[50];// creating the new variables
- tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),level = strval(tmp2);// setting them to strtok so we can use them as parameters of our command
- GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name
- format(file,sizeof(file),"Admin/%s.txt",n);//formatting the file
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,GREY,"You are not an RCON admin!");//if the player is not rcon admin
- if(sscanf(params, "ud", playerid, level)) return SendClientMessage(playerid, -1, "Usage: /setlevel [playerid] [level]"); // playerb - id of the player which will get the level
- if(!IsPlayerConnected(id))return SendClientMessage(playerid,GREY,"You have entered an incorrect ID"); //if the id is not connected
- PInfo[id][Level] = level;//sets the level of the player
- dini_IntSet(file,"Level",level);//saves the new level to the file
- format(str,sizeof(str),"You have set %s's level to %d",n,level);//creates the string
- SendClientMessage(playerid,LIGHTBLUE,str);
- return 1;
- }
- COMMAND:ahelp(playerid ,params[])
- {
- if(PInfo[ playerid][Level] < 1) return SendClientMessage(playerid, COLOR_RED, "Error: You must be atleast Admin Level 1 to use this command!");
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Admin level 1 commands");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Kick, Ban, ClearChat");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Freeze, Unfreeze, apm");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"ann, goto, gethere");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"spec, specoff, reports(for all players)");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"aduty, reply, fix, respawn");
- // Admin Level 2 Commands are the same as Level 1 but with some more from it
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Admin level 2 commands:");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Kick, Ban, ClearChat");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Freeze, Unfreeze, apm");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"ann, goto, gethere");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"spec, specoff, reports(for all players)");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"aduty, reply, fix");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"mute, unmute, givecash");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Setskin, setmoney, setscore");
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"givegun, resetweaps, sethealth");
- return 1;
- }
- }
- COMMAND:givegun(playerid, params[])
- {
- if(PInfo[playerid] [Level] < 2) return SendClientMessage(playerid, COLOR_RED,"Error:You must be atleast Admin Level 2 to use this command");
- {
- new id, gun, ammo;
- if(sscanf(params,"uii", id, gun, ammo)) return SendClientMessage(playerid, -1,"USAGE: /givegun [playerid/partofname] [gunid] [ammo]");
- if(gun > 47 || gun < 1) return SendClientMessage(playerid, -1,"GUN ID'S: 1-47");
- if(ammo > 999 || ammo < 1) return SendClientMessage(playerid, -1,"Ammo 1-999");
- GivePlayerWeapon(id, gun, ammo);
- }
- return 1;
- }
- COMMAND:apm(playerid, params[]) // Name of CMD apm
- {
- if(PInfo[playerid][Level] /*your enum could be different!*/ == 1) return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command!"); // If the player is NOT an admin, send him a message saying he can't use them
- new strsend[130], targetid; // strsend is a string that stores the message the player types in the parameters, targetid is the id of the player that the admin will send the message to
- if(sscanf(params, "us", targetid, strsend)) return SendClientMessage(playerid, COLOR_RED, "Usage: /apm [playerid] [Message]"); // Check with sscanf if the player has used the command correctly, if he hasn't, show him how to
- if(targetid == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot message yourself!");
- new str[35], name[MAX_PLAYER_NAME]; // MAX_PLAYER_NAME is he max characters that can be put in any SA:MP Name, name is the string which saves the name of the player, str is the string that will have the format of the message itself
- GetPlayerName(playerid, name, sizeof(name)); // Save Admin's name in string "name"
- format(str, sizeof(strsend), "Admin %s Says: %s", name, strsend); //Format of the message that will be sent to the Player, which will be saved in str
- SendClientMessage(targetid, COLOR_RED, str); // Send The Message to the player.
- GetPlayerName(targetid, name, sizeof(name)); // Save the Player's name in string "name"
- format(str, sizeof(strsend), "APM Sent to %s: %s", name, strsend); // Format of the message that will be sent to the Admin, which will be saved in str
- SendClientMessage(playerid, COLOR_RED, str); // Send Message to admin
- return 1;
- }
- COMMAND:ann(playerid,params[]) {
- new
- poster[40],
- mess[128];
- sscanf(params,"s",mess);
- if(PInfo[playerid][Level] >= 1) {
- if(!isnull(mess)) {
- new text[128];
- GetPlayerName(playerid,poster,sizeof(poster));
- format(text,sizeof(text),"[Announce] | Administrator \"%s\" has announced his message. (%s)",poster,mess);
- SendClientMessageToAll(COLOR_LIGHTBLUE,text);
- GameTextForAll(mess,5000,3);
- } else {
- return SendClientMessage(playerid,COLOR_RED,"USAGE: /announce [message], and all players will see this message on-screen.");
- }
- } else {
- return SendClientMessage(playerid,COLOR_RED," Admins level 1+ can use this command. Looking for a way to announce? Try /message!");
- }
- return 1;
- }
- COMMAND:goto(playerid, params[])
- {
- if(PInfo[playerid][Level] <1) return SendClientMessage(playerid,COLOR_RED, "You need to be admin level 1+ to use this command");
- new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
- if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /goto [id]");//checks if you have written something after /goto if no it sends error
- else if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "This player is offline or it is yourself");//checks if the player you are teleporting to is connected or if it is yourself if yes then comes an error
- else//ELSE what will happen if no errors
- {
- new Float:x, Float:y, Float:z;//creates new floats
- GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
- SetPlayerPos(playerid, x+1, y+1, z);//sets the player position the id of that player +1 in x +1 in y and z remains same as it defines height
- }
- return 1;
- }
- COMMAND:gethere(playerid,params[])
- {
- if(PInfo[playerid][Level] <1) return SendClientMessage(playerid,COLOR_RED, "You need to be admin level 1+ to use this command");
- new targetid, Float:x, Float:y, Float:z;//defines floats and [U]targetid(same which we did as id above)[/U]
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /gethere [id]");//checks if there is something written after /gethere if no sends the usage error
- if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "This player is offline or it is yourself");//checks if the player is conneted or not and also checks that we are not teleporting ourselves to our self :P if we are it sends error
- GetPlayerPos(playerid, x, y, z);//gets player pos PLAYER POS not targetid
- SetPlayerPos(targetid, x+1, y+1, z);//gets the TARGETID player to the PLAYERID x+1,y+1 and z remains same as it defines height
- return 1;
- }
- COMMAND:spec(playerid, params[])
- {
- new id;// This will hold the ID of the player you are going to be spectating.
- if(PInfo[playerid][Level] <1) return SendClientMessage(playerid,COLOR_RED, "You need to be admin level 1+ to use this command");
- if(sscanf(params,"u", id))return SendClientMessage(playerid, Grey, "Usage: /spec [id]");// Now this is where we use sscanf to check if the params were filled, if not we'll ask you to fill them
- if(id == playerid)return SendClientMessage(playerid,Grey,"You cannot spec yourself.");// Just making sure.
- if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, Grey, "Player not found!");// This is to ensure that you don't fill the param with an invalid player id.
- if(IsSpecing[playerid] == 1)return SendClientMessage(playerid,Grey,"You are already specing someone.");// This will make you not automatically spec someone else by mistake.
- GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// This is getting and saving the player's position in a variable so they'll respawn at the same place they typed '/spec'
- Inter[playerid] = GetPlayerInterior(playerid);// Getting and saving the interior.
- vWorld[playerid] = GetPlayerVirtualWorld(playerid);//Getting and saving the virtual world.
- TogglePlayerSpectating(playerid, true);// Now before we use any of the 3 functions listed above, we need to use this one. It turns the spectating mode on.
- if(IsPlayerInAnyVehicle(id))//Checking if the player is in a vehicle.
- {
- if(GetPlayerInterior(id) > 0)//If the player's interior is more than 0 (the default) then.....
- {
- SetPlayerInterior(playerid,GetPlayerInterior(id));//.....set the spectator's interior to that of the player being spectated.
- }
- if(GetPlayerVirtualWorld(id) > 0)//If the player's virtual world is more than 0 (the default) then.....
- {
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));//.....set the spectator's virtual world to that of the player being spectated.
- }
- PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));// Now remember we checked if the player is in a vehicle, well if they're in a vehicle then we'll spec the vehicle.
- }
- else// If they're not in a vehicle, then we'll spec the player.
- {
- if(GetPlayerInterior(id) > 0)
- {
- SetPlayerInterior(playerid,GetPlayerInterior(id));
- }
- if(GetPlayerVirtualWorld(id) > 0)
- {
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
- }
- PlayerSpectatePlayer(playerid,id);// Letting the spectator spec the person and not a vehicle.
- }
- GetPlayerName(id, Name, sizeof(Name));//Getting the name of the player being spectated.
- format(String, sizeof(String),"You have started to spectate %s.",Name);// Formatting a string to send to the spectator.
- SendClientMessage(playerid,0x0080C0FF,String);//Sending the formatted message to the spectator.
- IsSpecing[playerid] = 1;// Just saying that the spectator has begun to spectate someone.
- IsBeingSpeced[id] = 1;// Just saying that a player is being spectated (You'll see where this comes in)
- spectatorid[playerid] = id;// Saving the spectator's id into this variable.
- return 1;// Returning 1 - saying that the command has been sent.
- }
- COMMAND:specoff(playerid, params[])
- {
- if(PInfo[playerid][Level] <1) return SendClientMessage(playerid,COLOR_RED, "You need to be admin level 1+ to use this command");
- if(IsSpecing[playerid] == 0)return SendClientMessage(playerid,Grey,"You are not spectating anyone.");
- TogglePlayerSpectating(playerid, 0);//Toggling spectate mode, off. Note: Once this is called, the player will be spawned, there we'll need to reset their positions, virtual world and interior to where they typed '/spec'
- return 1;
- }
- COMMAND:report(playerid, params[])
- {
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], str[128], reason, iD;
- if (sscanf(params, "dz", iD, reason)) return SendClientMessage(playerid, 0xAA3333AA, "Usage: /report [id] [reason]");
- if (iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xAA3333AA, "Invalid ID.");
- GetPlayerName(playerid, pName, sizeof(pName));
- GetPlayerName(iD, aName, sizeof(aName));
- SendClientMessage(playerid,COLOR_RED,"Your report has been sent to admins");
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i))
- {
- new zName[MAX_PLAYER_NAME], pFile[256];
- GetPlayerName(i, zName, sizeof(zName));
- format(pFile, sizeof(pFile), "Admin\%s.ini", zName);
- if (PInfo[playerid][Level] <1)
- {
- format(str, sizeof(str), "%s(%d) has reported %s(%d) for: %s", pName, playerid, aName, iD, reason);
- SendClientMessage(i, 0xFFFFFFFF, str);
- }
- }
- }
- return 1;
- }
- COMMAND:aduty(playerid) //Doesnt need params function
- {
- if(PInfo[playerid][Level] >=1 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
- {
- if (aDuty[playerid] == 0) //Check if player is on duty
- {
- new string[128];
- new Float:x,Float:y,Float:z;
- new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0); //Creates 3d text label at player position
- GetPlayerPos(playerid,x,y,z); //Looks for players position
- SetPlayerHealth(playerid,999999); //makes player godmode
- SetPlayerColor(playerid,COLOR_DRED); //set admin colour red
- SetPlayerSkin(playerid,294); //set admin skin to 294
- format(string,sizeof(string), "Admin %s has just went on Duty please use /ask or /aask to ask a question!",GetPlayerNameEx(playerid)); //here you format string to send to players
- SendClientMessageToAll(COLOR_DRED,string); //send string to players
- SendClientMessage(playerid,COLOR_DRED,"You are now on duty!"); //Tell admin he is now on duty
- Attach3DTextLabelToPlayer(label,playerid,0.0, 0.0, 0.7); //attach 3d text label made before to player
- aDuty[playerid] = 1; //Set player on duty
- }
- else if (aDuty[playerid] == 1) //Check if player is on duty
- {
- new string[128];
- new Float:x,Float:y,Float:z;
- new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_DRED,x,y,z, 40.0, 0, 0);
- Delete3DTextLabel(label); //Delete 3d text label saying "Admin On Duty!"
- SetPlayerHealth(playerid,100); //sets player health back to 100
- format(string,sizeof(string),"Admin %s has now went off duty!",GetPlayerNameEx(playerid)); //Format string to send to players
- SendClientMessageToAll(COLOR_DRED,string); //send players string
- SendClientMessage(playerid, COLOR_DRED,"You are now off duty!"); //send admin message he is off duty
- aDuty[playerid] = 0; //sets admin off duty
- }
- }
- else
- SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!"); //Error message to send to players who arent admins
- return 1;
- }
- stock GetPlayerNameEx(playerid) //This is stock i made to make Getting players name easier
- {
- GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
- return Name;
- }
- COMMAND:ask(playerid,params[])
- {
- new string[128],playername[24];
- if(sscanf(params,"s[128]",params)) return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /ask [question]");
- GetPlayerName(playerid,playername,24);
- format(string,sizeof(string),"%s has requested help, question: %s",playername,params);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PInfo[playerid][Level] <1) return 1; // Or use your admin variable, e.g. if(PlayerInfo[playerid][pAdmin])
- {
- SendClientMessage(i,0x00FF00FF,string);
- }
- }
- }
- return 1;
- }
- COMMAND:reply(playerid,params[])
- {
- new string[128],playername[24],playerb;
- if(PInfo[playerid][Level] <1) return 0; //hides the command if they're not an admin
- if(sscanf(params,"us[128]",playerb,params)) return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /reply [id] [response]");
- if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid,0xFF0000FF,"Invalid player ID!");
- GetPlayerName(playerid,playername,24);
- format(string,sizeof(string),"%s has responded, response: %s",playername,params);
- SendClientMessage(playerb,0x00FF00FF,string);
- GetPlayerName(playerb,playername,24);
- format(string,sizeof(string),"You have replied to %s successfully",playername);
- SendClientMessage(playerid,0x0000FFFF,string);
- return 1;
- }
- COMMAND:afix(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,COLOR_RED, "You need to be atleast admin level 1 to use this command");
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
- RepairVehicle(GetPlayerVehicleID(playerid));
- SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
- }
- return 1;
- }
- COMMAND:respawn(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
- new targetid;
- targetid = strval(params); // string value
- if(!strlen(params)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /respawn [name / id]");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
- new string[128];
- new pName[24], pTame[24];
- GetPlayerName(playerid,pName,24);
- GetPlayerName(targetid,pTame,24);
- format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been respawned by Administrator %s.",pTame,pName);
- SendClientMessageToAll(COLOR_RED, string);
- SpawnPlayer(targetid);
- return 1;
- }
- COMMAND:givecash(playerid,params[])
- {
- new pname[24], cash, targetid, string[128];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Error: You are not admin");
- if(sscanf(params,"ui",targetid, cash)) return SendClientMessage(playerid,-1,"USAGE: /gc [playerid] [cash]");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: That player isn't online!");
- GetPlayerName(targetid, pname, 24);
- GivePlayerMoney(targetid, cash);
- format(string, 128, "** ADMIN CASH: You have been given $%d.", cash);
- SendClientMessage(targetid,0xFF00FFFF,string);
- return 1;
- }
- COMMAND:mute(playerid,params[])
- {
- new id, reason[60];
- if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid, 0xFF0000FF, "You Must Be An Administrator To Use This Command!");
- //Obviously replace pInfo[playerid][AdminVariable] with your own admin variable, does not have to be 2, change at will.
- if(sscanf(params, "us(No Reason)", id, reason)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX ERROR: {00FF00}/MUTE {FFFF00}<PlayerID> <Optional: Reason>");
- if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Not Connected.");
- if(Muted[id] == 1) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Already Muted. Use {00FF00}/UNMUTE{FF0000}.");
- Muted[id] = 1;
- new string[150];
- new TargetName[MAX_PLAYER_NAME], AdminName[MAX_PLAYER_NAME];
- GetPlayerName(id, TargetName, MAX_PLAYER_NAME);
- GetPlayerName(playerid, AdminName, MAX_PLAYER_NAME);
- format(string,sizeof(string),"You Have Been Muted By Administrator %s | Reason: %s", AdminName, reason);
- SendClientMessage(id, 0xFF0000FF, string);
- format(string,sizeof(string),"You Have Muted %s | Reason: %s", TargetName, reason);
- SendClientMessage(playerid, 0xFFFF00FF, string);
- format(string,sizeof(string),"%s Has Been Muted By Administrator %s | Reason: %s", TargetName, AdminName, reason);
- SendClientMessageToAll(0xFF0000FF, string);
- return 1;
- }
- COMMAND:unmute(playerid,params[])
- {
- new id;
- if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid, 0xFF0000FF, "You Must Be An Administrator To Use This Command!");
- //Same rules apply here as above.
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000FF, "SYNTAX ERROR: {00FF00}/UNMUTE {FFFF00}<PlayerID>");
- if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Not Connected.");
- if(Muted[id] == 0) return SendClientMessage(playerid, 0xFF0000FF, "This Player Is Already Unmuted. Use {00FF00}/MUTE{FF0000}.");
- Muted[id] = 0;
- new string[150];
- new TargetName[MAX_PLAYER_NAME], AdminName[MAX_PLAYER_NAME];
- GetPlayerName(id, TargetName, MAX_PLAYER_NAME);
- GetPlayerName(playerid, AdminName, MAX_PLAYER_NAME);
- format(string,sizeof(string),"You Have Been Unmuted By Administrator %s.",AdminName);
- SendClientMessage(id, 0xFFFF00FF, string);
- format(string,sizeof(string),"You Have Unmuted %s.",TargetName);
- SendClientMessage(playerid, 0xFFFF00FF, string);
- format(string,sizeof(string),"%s Has Been Unmuted By %s.",TargetName,AdminName);
- SendClientMessageToAll(0xFFFF00FF, string);
- return 1;
- }
- COMMAND:setskin(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)return SendClientMessage(playerid, COLOR_GREY, "You must be a administrator or moderator to use this command"), true;
- if (aDuty[playerid] == 0)return SendClientMessage(playerid, COLOR_GREY, "You must be on duty to perform this command"), true;
- new Player, Skinid;
- if(sscanf(params, "ui", Player, Skinid))
- return SendClientMessage(playerid, COLOR_GREY, "[Command Usage]: /setskin [PlayerID or Name] [SkinID]"), true;
- if(Player == INVALID_PLAYER_ID)
- return SendClientMessage(playerid, COLOR_GREY, "Invalid player name or id entered!"), true;
- new string[128];
- format(string, sizeof(string), "Your skin has been set to %i by %s", Skinid, GetPlayerNameEx(playerid));
- SendClientMessage(Player, COLOR_RED, string);
- format(string, sizeof(string), "You have set %s's skin to %i", GetPlayerNameEx(Player), Skinid);
- SendClientMessage(playerid, COLOR_RED, string);
- SetPlayerSkin(Player, Skinid);
- return true;
- }
- COMMAND:setmoney ( playerid , params [] )
- {
- if (PInfo[playerid][Level] < 1) return SendClientMessage(playerid, COLOR_RED," You are not admin ");
- new id , ammount;
- if ( !IsPlayerConnected ( id ) ) return SendClientMessage ( playerid , -1 , "Invalid Player ID" ) ;
- if ( ammount < 0 || ammount > 10000000000 ) return SendClientMessage ( playerid , -1 , "You can give more than 10000000000$" ) ;
- if ( GetPlayerMoney ( playerid ) < ammount ) return SendClientMessage ( playerid , -1 , "You cant give money more than you have." ) ;
- if ( sscanf ( params , "ui" , id , ammount ) ) return SendClientMessage ( playerid , -1 , "Usage : /setmoney [ID] [Ammount]" ) ;
- else
- {
- new IName [ MAX_PLAYER_NAME ] , PName [ MAX_PLAYER_NAME ] , Str [ 128 ] ;
- GetPlayerName ( id , IName , MAX_PLAYER_NAME ) ;
- GetPlayerName ( playerid , IName , MAX_PLAYER_NAME ) ;
- format ( Str , 128 , "%s Has Given You %d" , IName , ammount ) ;
- SendClientMessage ( id , COLOR_RED, Str ) ;
- format ( Str , 128 , "You Gave %d Money To %s" , ammount , PName ) ;
- SendClientMessage ( playerid , COLOR_RED , Str ) ;
- GivePlayerMoney ( id , ammount ) ;
- }
- return 1;
- }
- COMMAND:setscore(playerid, params[]) {
- new id; // "defines" the targets id.
- new score; // Gets the targets score ( was added to prevent an error.)
- new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, name, sizeof(name));
- if(PInfo[playerid][Level] <2) return SendClientMessage(playerid, COLOR_ORANGE, "You're not allowed to use this command!"); //If the player who typed the command isn't logged in via the RCON, he will receive this "error" message.
- if(sscanf(params, "ui", id, score)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /setscore [ID] [SCORE]"); //If there aren't enough params typed in(ex - /setscore ID)
- if(score < 1) return SendClientMessage(playerid, COLOR_ORANGE, "You need to give more than 1 score."); //This isn't really needed, but it "forces" the admin to give the player more than 1 score.
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ORANGE, "Target is not online."); //If the targets id isn't "valid", the admin will receive this "error" message, cause there was no ID found.
- SetPlayerScore(id, score); //Sets the targets score.
- format(string, sizeof(string), "Administrator %s has given you some score!", name); //Target receives this message.
- SendClientMessage(id, COLOR_ORANGE, string);
- return 1;
- }
- COMMAND:resetweaps(playerid, params[])
- {
- if(PInfo[playerid][Level] <2) return SendClientMessage(playerid, 0xFF3300, "You're not a server admin");
- foreach (Player, i)
- ResetPlayerWeapons(i);
- return 1;
- }
- COMMAND:sethealth(playerid, params[])
- {
- new id;
- new Float:hp;
- if(PInfo[playerid][Level] >= 6)
- {
- if(!sscanf(params, "uf", id, hp))
- {
- if(!IsPlayerConnected(id))
- {
- SendClientMessage(playerid, -1, "SERVER: The player isn't connected.");
- return 1;
- }
- new string[64];
- new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(id, PlayerName, sizeof(PlayerName));
- format(string, sizeof(string), "SERVER: Administrator %s has set your health to %f", name, hp);
- SendClientMessage(id, COLOR_RED, string);
- format(string, sizeof(string), "SERVER: You have Set %s health to %f.", PlayerName, hp);
- SendClientMessage(playerid, COLOR_RED, string);
- SetPlayerHealth(id, hp);
- return 1;
- }
- else return SendClientMessage(playerid, -1, "SERVER: /sethealth [PlayerId/PartOfName] [Hp]");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You cannot use this command.");
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment