15.10.2013, 19:55
Hello, I got a problem with my newbie chat code.
I got a helper system in the script, but they dont get the helper tag in the newbie chat. No idea why.
This is the code:
I got a helper system in the script, but they dont get the helper tag in the newbie chat. No idea why.
This is the code:
pawn Код:
CMD:newbie(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, RED, "[Survival:RP] You are not logged in");
return 1;
}
if((noff) && PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, RED, "[Survival:RP] Newbie channel is disabled");
return 1;
}
if(NewbieTimer[playerid] == 1 && PlayerInfo[playerid][pAdmin] < 3 && PlayerInfo[playerid][pHelper] == 0)
{
SendClientMessage(playerid, COLOR_GRAY, "Wait before using (/n)ewbie again");
return 1;
}
if(PlayerInfo[playerid][pMute] == 1)
{
SendClientMessage(playerid, RED, "[Survival:RP] You cant speak, You are muted");
return 1;
}
new sendername[MAX_PLAYER_NAME];
new string[258];
new idx;
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(params);
while ((idx < length) && (params[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = params[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, RED, "[Survival:RP] (/n)ewbie [TEXT]");
return 1;
}
NewbieTimer[playerid] = 1;
SetTimerEx("newbie", 60000, false, "i", playerid);
new adminstext[256];
if(PlayerInfo[playerid][pAdmin] == 6) { adminstext = "Owner/Developer"; }
else if(PlayerInfo[playerid][pCoOwner] == 1) { adminstext = "Co Owner"; }
else if(PlayerInfo[playerid][pCoOwner] == 8) { adminstext = "Owner"; }
else if(PlayerInfo[playerid][pAdmin] == 5) { adminstext = "Head Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { adminstext = "Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { adminstext = "Low Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { adminstext = "Moderator"; }
else if(PlayerInfo[playerid][pAdmin] == 1) { adminstext = "Trial Adminstratior"; }
else if(PlayerInfo[playerid][pAdmin] == 0) { adminstext = "Regular Player"; }
else if(PlayerInfo[playerid][pHelper] == 1) { adminstext = "Helper"; }
else if(PlayerInfo[playerid][pHelper] == 2) { adminstext = "Lead Helper"; }
else if(PlayerInfo[playerid][pVip] == 1) { adminstext = "Bronze V.I.P"; }
else if(PlayerInfo[playerid][pVip] == 2) { adminstext = "Silver V.I.P"; }
else if(PlayerInfo[playerid][pVip] == 3) { adminstext = "Gold V.I.P"; }
format(string, sizeof(string), "Newbie Channel: [%s %s]: %s", adminstext, sendername, result);
OOC(NEWBIE_COLOR,string);
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
format(string,sizeof(string),"[%02d:%02d:%02d][OOC:%s:] %s",Hour,Minute,Second,sendername,result);
SaveIn("NewbieLog.txt",string);
}
return 1;
}