10.08.2012, 16:47
Hello (again)
Can someone help me with an /aduty command ? I killed my brain trying to make it ...
Can someone help me with an /aduty command ? I killed my brain trying to make it ...
dcmd_onduty(playerid,params[])
{
#pragma unused params
if (AccInfo[playerid][Level] >= 1)
{
if(AccInfo[playerid][OnDuty] == 0)
{
AccInfo[playerid][OnDuty] = 1;
return SendClientMessage(playerid,green,"You are now in [Duty Mode] ");
}
else
{
AccInfo[playerid][OnDuty] = 0;
return SendClientMessage(playerid,orange,"You are now in [Playing Mode] ");
}
}
return 1;
}
pawn Код:
|
// top of script
new OnDuty[MAX_PLAYERS];
// command USING ZCMD
CMD:duty(playerid,params[])
{
// if the player isnt logged into rcon , it will send the below message (change it to your desire)
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Invalid Command. Type /commands For A List Of Commands.");
if(OnDuty[playerid] == 0)
{
GameTextForPlayer(playerid,"~g~ on duty");
SetPlayerSkin(playerid,skinid); // set your desired skin here
SetPlayerHealth(playerid,100000);
GivePlayerWeapon(playerid,38,133337);
OnDuty[playerid] = 1;
}
else
{
GameTextForPlayer(playerid,"~r~ off duty");
SetPlayerSkin(playerid,skinid); // set your desired skin here
SetPlayerHealth(playerid,100);
ResetPlayerWeapons(playerid);
OnDuty[playerid] = 0;
}
return 1;
}
Thanks but i don't want in RCON , just from admin level 1 to 1338 and without using zcmd ...
|
if (strcmp("/duty", cmdtext, true, 5) == 0)
{
// if the player isnt logged into rcon , it will send the below message (change it to your desire)
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Invalid Command. Type /commands For A List Of Commands.");
if(OnDuty[playerid] == 0)
{
GameTextForPlayer(playerid,"~g~ on duty");
SetPlayerSkin(playerid,skinid); // set your desired skin here
SetPlayerHealth(playerid,100000);
GivePlayerWeapon(playerid,38,133337);
OnDuty[playerid] = 1;
}
else
{
GameTextForPlayer(playerid,"~r~ off duty");
SetPlayerSkin(playerid,skinid); // set your desired skin here
SetPlayerHealth(playerid,100);
ResetPlayerWeapons(playerid);
OnDuty[playerid] = 0;
}
return 1;
}
PlayerInfo[playerid][pAdmin] >= 1 |
if (strcmp("/duty", cmdtext, true, 5) == 0)
{
if(PlayerInfo[playerid][pAdmin] <= 0) return SendClientMessage(playerid,-1,"Invalid Command. Type /commands For A List Of Commands.");
if(OnDuty[playerid] == 0)
{
GameTextForPlayer(playerid,"~g~ on duty");
SetPlayerSkin(playerid,skinid); // set your desired skin here
SetPlayerHealth(playerid,100000);
GivePlayerWeapon(playerid,38,133337);
OnDuty[playerid] = 1;
}
else
{
GameTextForPlayer(playerid,"~r~ off duty");
SetPlayerSkin(playerid,skinid); // set your desired skin here
SetPlayerHealth(playerid,100);
ResetPlayerWeapons(playerid);
OnDuty[playerid] = 0;
}
return 1;
}