06.06.2014, 09:08
Hello all know theres alot of people in the future and present who may need this CMD for there servers so im teaching you how to make it.
First you must add this at the top of your script. this will make the variables to save your skin & color.
Now Lets make the CMD
Your gonna need a /offduty command right?
And Boom Your done xD. Please dont say this is too easy,etc this is for beginner server owners who need a onduty cmd and instead of searching on ****** for hours here it is
First you must add this at the top of your script. this will make the variables to save your skin & color.
pawn Code:
#include <zcmd>
new oldskin[ MAX_PLAYERS ];// Save Your Old Skin
new oldcolor[ MAX_PLAYERS ]; //Save Your Old Color
Now Lets make the CMD
pawn Code:
CMD:onduty(playerid,params[])
{
if(pInfo[playerid][pLevel] >= 1) //This is to see if the player is admin or not. All admin systems have diffrent ones so add the one you use
{
oldcolor[ playerid ] = GetPlayerColor( playerid ); // This will Get the players color.
oldskin[ playerid ] = GetPlayerSkin( playerid ); // This Will Get the Players Skin.
ResetPlayerWeapons(playerid); //This Is to Reset player weapons so they wont have there guns (For the admins wont abuse,etc)
SendClientMessage(playerid,yellow,"{1AE694}» {EA15D5}You're now on duty. (Dont abuse it"); //Notfiys The Admin That hes on duty.
GivePlayerWeapon(playerid,38,9000); //Gives Player A minigun
GivePlayerWeapon(playerid,43,100);// Gives Player A Camera To take pictures of cheaters/hackers.
SetPlayerSkin(playerid,189); //Set Player Skin To A Valet. (Its my admin skin in my server) Change it to whatever you like (294,etc)
SetPlayerHealth(playerid,10000); // Put the Player On God Mode
SetPlayerColor(playerid,0xEA15D5C8); // Set Player's Color Pink (Admins color right?)
new playrname[ MAX_PLAYER_NAME ], string[ 256 ]; // new's
GetPlayerName(playerid, playrname, sizeof(playrname));
format(string, 256, "{51AEAE}» {EA15D5}Admin {3AF20D}%s(%d) {FFFFFF}Is Now on Admin-duty. Do not shoot him.", playrname, playerid);
SendClientMessageToAll( 0x0DF224C8, string ); //This notifys all players that the player is on admin duty.
}
return 1;
}
pawn Code:
CMD:offduty(playerid,params[])
{
if(pInfo[playerid][pLevel] >= 1) //This is to see if the player is admin or not. All admin systems have diffrent ones
{
SetPlayerSkin(playerid,oldskin[playerid]); //Sets player skin to the one it was before
ResetPlayerWeapons(playerid);// Reset Player Weapons
GivePlayerWeapon(playerid,24,400); // This gives the player the weapons he had before he /onduty
GivePlayerWeapon(playerid,25,400); // (It's the default spawn weapons on my server)
GivePlayerWeapon(playerid,29,1000); // Set it to whatever you like
GivePlayerWeapon(playerid,30,1000); // Set it to whater you like
SetPlayerColor(playerid,oldcolor[playerid]); //Sets Player color to the one it was before.
SendClientMessage(playerid,yellow,"{EE11EE}» {FFFFFF}Your now off duty"); //Notifys player that he's offduty
}
return 1;
}