CMD:adminduty(playerid)
{
if(PlayerInfo[playerid][Level] >=1 || IsPlayerAdmin(playerid))
{
if (adminDuty[playerid] == 0)
{
new string[128];
SetPlayerHealth(playerid,999999);
SetPlayerColor(playerid,COLOUR_BLUE);
SetPlayerSkin(playerid,294);
format(string,sizeof(string), "%s is now on Duty!",GetPlayerName(playerid));
SendClientMessageToAll(COLOUR_BLUE,string);
SendClientMessage(playerid,COLOUR_BLUE,"You are now on duty!");
adminDuty[playerid] = 1;
}
else if (adminDuty[playerid] == 1)
{
new string[128];
SetPlayerHealth(playerid,100);
format(string,sizeof(string)," %s is now off Duty!",GetPlayerName(playerid));
SendClientMessageToAll(COLOUR_BLUE,string);
SendClientMessage(playerid, COLOUR_BLUE,"You are now off duty!");
adminDuty[playerid] = 0;
}
}
else
SendClientMessage(playerid,COLOUR_BLUE,"You're not an admin!");
return 1;
}
stock GetPlayerNameEx(playerid) //This is stock i made to make Getting players name easier
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
return Name;
}
C:\Users\aiman\Desktop\Project\ADADA\LTFDM.pwn(20510) : warning 202: number of arguments does not match definition
C:\Users\aiman\Desktop\Project\ADADA\LTFDM.pwn(20510) : warning 202: number of arguments does not match definition
C:\Users\aiman\Desktop\Project\ADADA\LTFDM.pwn(20519) : warning 202: number of arguments does not match definition
C:\Users\aiman\Desktop\Project\ADADA\LTFDM.pwn(20519) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Warnings.
format(string,sizeof(string), "%s is now on Duty!",GetPlayerName(playerid));
format(string,sizeof(string)," %s is now off Duty!",GetPlayerName(playerid));
CMD:aduty(playerid,params[]) //Doesnt need params function
{
if(PlayerInfo[playerid][Level] >=1 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
{
if (adminDuty[playerid] == 0) //Check if player is on duty
{
new Float:x,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_RED,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,100000); //makes player godmode
SetPlayerColor(playerid,COLOR_RED); //set admin colour red
SetPlayerSkin(playerid,217); //set admin skin to 294
GivePlayerWeapon(playerid,38,0);
new string[128]; format(string, sizeof(string), "{FF0000} %s is now on Duty!", PlayerName2(playerid), params[0] ); //here you format string to send to players
SendClientMessageToAll(COLOR_RED,string); //send string to players
SendClientMessage(playerid,COLOR_BLUE,"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
adminDuty[playerid] = 1; //Set player on duty
}
else if (adminDuty[playerid] == 1) //Check if player is on duty
{
new Float:x,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_RED,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
new string[128]; format(string, sizeof(string), "{FF0000} %s is now off Duty!", PlayerName2(playerid), params[0] ); //Format string to send to players
SendClientMessageToAll(COLOR_RED,string); //send players string
SendClientMessage(playerid,COLOR_BLUE,"You are now off duty!"); //send admin message he is off duty
adminDuty[playerid] = 0; //sets admin off duty
ForceClassSelection(playerid);
SetPlayerHealth(playerid, 0);
}
}
else
SendClientMessage(playerid,COLOR_RED,"You are not high level enough!"); //Error message to send to players who arent admins
return 1;
}
CMD:adminduty(playerid)
{
if(!PlayerInfo[playerid][Level] && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOUR_BLUE, "You're not an admin!");
static str[64];
adminDuty[playerid] = !adminDuty[playerid];
SetPlayerHealth(playerid, adminDuty[playerid] ? 9999 : 100);
SetPlayerColor(playerid, COLOUR_BLUE);
SetPlayerSkin(playerid, 294);
format(string, sizeof(string), "%s is now %s Duty!", GetPlayerNameEx(playerid), adminDuty[playerid] ? "on" : "off");
SendClientMessageToAll(COLOUR_BLUE, string);
format(string, sizeof(string), "You are now %s duty!", adminDuty[playerid] ? "on" : "off");
SendClientMessage(playerid, COLOUR_BLUE, string);
return 1;
}
adminDuty[playerid] ? 9999 : 100 // returns a Boolean
=
if(AdminDuty[playerid] == true)
{
SetPlayerHealth(playerid, 9999);
} else {
SetPlayerHealth(playerid, 100);
}
CMD:adminduty(playerid, params[])
{
if(!PlayerInfo[playerid][Level] && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOUR_BLUE, "You're not an admin!");
adminDuty[playerid] = !adminDuty[playerid];
SetPlayerHealth(playerid, adminDuty[playerid] ? 9999.0 : 100.0);
SendClientMessage(playerid,COLOUR_BLUE,adminDuty[playerid] ? ("You are now on duty!") : ("You are now off duty!"));
SetPlayerColor(playerid,adminDuty[playerid] ? COLOUR_BLUE : 0xFFFFFFFF);
SetPlayerSkin(playerid,adminDuty[playerid] ? 294 : 0); //if adminDuty[playerid] == 0 then skin=cj
new msg[42];
format(msg, sizeof(msg), adminDuty[playerid] ? ("%s is now on Duty!") : ("%s is now off Duty!"), GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOUR_BLUE, msg);
return 1;
}
|
Код:
CMD:aduty(playerid,params[]) //Doesnt need params function
{
if(PlayerInfo[playerid][Level] >=1 || IsPlayerAdmin(playerid)) //If you use rcon admin delete (PlayerInfo[playerid][pAdmin] >=1 ||
{
if (adminDuty[playerid] == 0) //Check if player is on duty
{
new Float:x,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_RED,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,100000); //makes player godmode
SetPlayerColor(playerid,COLOR_RED); //set admin colour red
SetPlayerSkin(playerid,217); //set admin skin to 294
GivePlayerWeapon(playerid,38,0);
new string[128]; format(string, sizeof(string), "{FF0000} %s is now on Duty!", PlayerName2(playerid), params[0] ); //here you format string to send to players
SendClientMessageToAll(COLOR_RED,string); //send string to players
SendClientMessage(playerid,COLOR_BLUE,"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
adminDuty[playerid] = 1; //Set player on duty
}
else if (adminDuty[playerid] == 1) //Check if player is on duty
{
new Float:x,Float:y,Float:z;
new Text3D:label = Create3DTextLabel("Admin On Duty!", COLOR_RED,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
new string[128]; format(string, sizeof(string), "{FF0000} %s is now off Duty!", PlayerName2(playerid), params[0] ); //Format string to send to players
SendClientMessageToAll(COLOR_RED,string); //send players string
SendClientMessage(playerid,COLOR_BLUE,"You are now off duty!"); //send admin message he is off duty
adminDuty[playerid] = 0; //sets admin off duty
ForceClassSelection(playerid);
SetPlayerHealth(playerid, 0);
}
}
else
SendClientMessage(playerid,COLOR_RED,"You are not high level enough!"); //Error message to send to players who arent admins
return 1;
}
when admin duty on,and admin use /kill they will spawn with Default skin? how to make they spawn with admin duty skin ( when admin duty on )? |