01.09.2012, 10:46
Hello, I want to make a ''senate'' radio that goes out to all the criminal factions radio but when i try it apparentley i dont have the level to use it.. The senate is going to be a rank that everyone can get, this is not going to be a faction! Here is the senate radio:
and if you need, here is also the senate ranks:
pawn Код:
if(strcmp(cmd, "/Senate", true) == 0 || strcmp(cmd, "/sen", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMara] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You are NOT part of the Senate!");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/sen)ate [senate radio annouce]");
return 1;
}
if(PlayerInfo[playerid][pMara] == 1)
{
if(PlayerInfo[playerid][pMara] == 3) { format(string, sizeof(string), "[Criminal Senate]:Lead Senator (radio): %s, over.", sendername, result);}
else if(PlayerInfo[playerid][pMara] == 2) { format(string, sizeof(string), "[Criminal Senate]:Senior Senator (radio): %s, over.", sendername, result);}
else if(PlayerInfo[playerid][pMara] == 1) { format(string, sizeof(string), "[Criminal Senate]:Junior Senator (radio): %s, over.", sendername, result);}
else
{
format(string, sizeof(string), " [Unknown] [Criminal Senate] (radio): %s, over.", sendername, result);
}
ProxDetector(7.5, playerid, string,COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
SentMessage[playerid] = 1;
SendRadioMessage(5 || 6 || 8 || 13 || 14 || 15 || 16 || 17 || 18, TEAM_RADIO_COLOR, string);
SentMessage[playerid] = 0;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,d);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (radio): (%s)",d,m,y,h,mi,s, sendername, result);
RadioChatLog(string);
return 1;
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/givemararank", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /givemararank [playerid/PartOfName] [level(1-3)]");
return 1;
}
new para1;
new level;
new plevel;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
plevel = PlayerInfo[para1][pMara];
if(PlayerInfo[playerid][pMara] == 3 || PlayerInfo[playerid][pAdmin] >= 1400 )
{
if(IsPlayerConnected(para1))
{
new atext[32];
if(para1 != INVALID_PLAYER_ID)
{
if(level == plevel)
{
SendClientMessage(playerid, COLOR_GREY, "Already that level!");
return 1;
}
if(level < 0 || level > 3)
{
return SendClientMessage(playerid, COLOR_GREY,"Only levels 0-3 Are allowed!");
}
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
new Float:X, Float:Y, Float:Z;
GetPlayerPos(para1, X,Y,Z);
if(level == 1){ atext = "Senator"; }
else if(level == 2){ atext = "Senior Senator"; }
else if(level == 3){ atext = "Lead Senator"; }
PlayerInfo[para1][pMara] = 3;
if(level == 1)
{
format(string, sizeof(string), "You are now part in the Criminal Senate!", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
PlayerInfo[para1][pMara] = 1;
}
if(level == 2)
{
format(string, sizeof(string), "You has been promoted.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
PlayerInfo[para1][pMara] = 1;
}
if(level == 3)
{
format(string, sizeof(string), "You has been promoted.", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
PlayerInfo[para1][pMara] = level;
}
if(level == 0)
{
format(string, sizeof(string), "You has been kicked from the Senate!", giveplayer, para1, atext, level);
SendClientMessage(playerid, COLOR_YELLOW2, string);
PlayerInfo[para1][pMara] = 0;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave to %s VIP Level: [%d].",d,m,y,h,mi,s,sendername,giveplayer,level);
LoginLog(string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Not authorized!");
return 1;
}
}
return 1;
}