19.06.2013, 08:26
I have two types of commands
Here's one set
And the second code
I would like the first code converted into the second code could anyone help me in doing so?
Here's one set
pawn Код:
CMD:o(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 7) {
new string[128]; format(string, sizeof(string), "[OWNER] %s: %s", PlayerName2(playerid), params[0] );
MessageToAdmins(green,string);
} else return SendClientMessage(playerid,red,"ERROR: You need to be owner to use this command");
return 1;
}
CMD:a(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 3) {
new string[128]; format(string, sizeof(string), "[ADMIN] %s: %s", PlayerName2(playerid), params[0] );
MessageToAdmins(green,string);
} else return SendClientMessage(playerid,red,"ERROR: You need to be admin to use this command");
return 1;
}
CMD:m(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 2) {
new string[128]; format(string, sizeof(string), "[MOD] %s: %s", PlayerName2(playerid), params[0] );
MessageToAdmins(green,string);
} else return SendClientMessage(playerid,red,"ERROR: You need to be moderator to use this command");
return 1;
}
CMD:v(playerid,params[]) {
#pragma unused params
if(PlayerInfo[playerid][Level] >= 1) {
new string[128]; format(string, sizeof(string), "[VIP] %s: %s", PlayerName2(playerid), params[0] );
MessageToAdmins(green,string);
} else return SendClientMessage(playerid,red,"ERROR: You need to be a VIP to use this command");
return 1;
}
pawn Код:
//==============================================================================
// Vip Chat
//==============================================================================
if(text[0] == '*' && AccInfo[playerid][pVip] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"|ChatVip| %s: %s",string,text[1]);
MessageToPlayerVIP(0xDC686BAA,string);
SaveIn("ChatVipLog",string);
return 0;
}
//==============================================================================
// Administration Chat
//==============================================================================
if(text[0] == '#' && AccInfo[playerid][Level] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
MessageToAdmins(green,string);
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"9Admin Chat: %s: %s",string,text[1]);
IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, string);
#if ADM_CHAT_LOG == true
SaveIn("AdmChatLog",string);
#endif
return 0;
}