How to Convert This?? (rep++++) -
iOmar - 11.04.2012
===> I have made this /onduty and /offduty cmd. But i don't no how to write it in zcmd?? Like "dcmd_onduy"??
Can please anyone Convert this??
pawn Код:
//------------------------------------------------------------------------------
if(strcmp(cmd, "/onduty", true) == 0) {
if(PlayerInfo[playerid][Level] >= 2) {
CMDMessageToAdmins(playerid,"Now On Duty"); GetPlayerName(playerid, adminname, sizeof(adminname));
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) {
SetPlayerSkin(playerid,217); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,pink); format(string,256,"Administrator %s Has Now On Admin Duty",adminname); SendClientMessage(i,pink,string); }
}
} else {
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }
return 1; }
//------------------------------------------------------------------------------
if(strcmp(cmd, "/offduty", true) == 0)
{
if(PlayerInfo[playerid][Level] >= 2)
{
CMDMessageToAdmins(playerid,"Now Off Duty"); GetPlayerName(playerid, adminname, sizeof(adminname));
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) {
ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
format(string,256,"Administrator %s Has End With His Admin Duty",adminname);
SendClientMessage(i,pink,string); }
}
} else {
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }
return 1; }
Re: How to Convert This?? (rep++++) -
Tee - 11.04.2012
pawn Код:
CMD:onduty(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 2)return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
CMDMessageToAdmins(playerid,"Now On Duty");
GetPlayerName(playerid, adminname, sizeof(adminname));
SetPlayerSkin(playerid,217);
GivePlayerWeapon(playerid,38,500000);
SetPlayerHealth(playerid,100000);
SetPlayerColor(playerid,pink);
format(string,256,"Administrator %s Has Now On Admin Duty",adminname);
SendClientMessage(i,pink,string);
return 1;
}
CMD:offduty(playerid, params[])
{
if(PlayerInfo[playerid][Level] < 2)return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
CMDMessageToAdmins(playerid,"Now On Duty");
GetPlayerName(playerid, adminname, sizeof(adminname));
ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
format(string,256,"Administrator %s Has End With His Admin Duty",adminname);
SendClientMessage(i,pink,string);
return 1;
}
And I removed some unnecessary stuff you had.
Re: How to Convert This?? (rep++++) -
Derek_Westbrook - 11.04.2012
Well find it out yourself we are not your Scripting slaves...
CMD

nduty(playerid,params[])
Re: How to Convert This?? (rep++++) -
zSuYaNw - 11.04.2012
pawn Код:
// InOnPlayerCommandText
dcmd(offduty, 7, cmdtext);
dcmd(onduty, 6, cmdtext);
// Any part of script
dcmd_offduty(playerid, params[]){
{
if(PlayerInfo[playerid][Level] >= 2)
{
CMDMessageToAdmins(playerid,"Now Off Duty"); GetPlayerName(playerid, adminname, sizeof(adminname));
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
format(string,256,"Administrator %s Has End With His Admin Duty",adminname);
SendClientMessage(i,pink,string);
}
}
}
else
{
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }
return 1;
}
return true;
}
dcmd_onduty(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 2)
{
CMDMessageToAdmins(playerid,"Now On Duty"); GetPlayerName(playerid, adminname, sizeof(adminname));
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
SetPlayerSkin(playerid,217); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,pink); format(string,256,"Administrator %s Has Now On Admin Duty",adminname); SendClientMessage(i,pink,string); }
}
}
else
{
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }
return 1;
}
}
return true;
}
Re: How to Convert This?? (rep++++) -
ProdrifterX - 11.04.2012
pawn Код:
dcmd(dutyoff, 7, cmdtext);
dcmd(dutyon, 6, cmdtext);
dcmd_dutyoff(playerid, params[]){
{
if(PlayerInfo[playerid][Level] >= 4)
{
CMDMessageToAdmins(playerid,"Now Off Duty"); GetPlayerName(playerid, adminname, sizeof(adminname));
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
format(string,256,"Administrator %s is not anymore Admin Duty",adminname);
SendClientMessage(i,pink,string);
}
}
}
else
{
SendClientMessage(playerid,red,"ERROR: You are not allowed to use this command"); }
return 1;
}
return true;
}
dcmd_dutyon(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 4)
{
CMDMessageToAdmins(playerid,"Now On Duty"); GetPlayerName(playerid, adminname, sizeof(adminname));
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,white); format(string,256,"Administrator %s is on duty now",adminname); SendClientMessage(i,pink,string); }
}
}
else
{
SendClientMessage(playerid,red,"ERROR: You are not allowed use this command"); }
return 1;
}
}
return true;
}
iam using something like this :P
Re: How to Convert This?? (rep++++) -
iOmar - 11.04.2012
Thnx All. I gave rep all of you except dereck...
@Dereck what the hell are u?? Why are u posting in my topic if you don't know anything. Getoff. I know you are just increasing your post. Sa-mp is platform for helping. All player post here and c00l guys help them. But like you..............................
Re: How to Convert This?? (rep++++) -
sanjil_rijal - 11.04.2012
Well i support whatever iOmar Said.
Re: How to Convert This?? (rep++++) -
iOmar - 11.04.2012
tHnx Bro