CMD:am(playerid, params[])
{
new string[256];
if(gPlayerLogged{playerid} == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
return 1;
}
if(PlayerInfo[playerid][pTut] == 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do that at this time.");
return 1;
}
if(PlayerInfo[playerid][pAmute] == 1) {
SendClientMessageEx(playerid, COLOR_RED, "You are muted from using /am!");
return 1;
}
if(noam == 1 && PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, " The Admin Message System has been disabled by an adminstrator, try again later.");
return 1;
}
if(PlayerInfo[playerid][pHelper]< 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 15;
}
if(PlayerInfo[playerid][pHelper] >= 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 5;
}
if(IsAdmin(playerid))
{
NewbieTimer[playerid] = 0;
}
if(NewbieTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
SendClientMessageEx(playerid, COLOR_GREY, string);
return 1;
}
if(IsAdmin(playerid))
{
new toid, message[128];
if(sscanf(params, "is[128]", toid, message)) return Syntax(playerid, "[a]dmin[m]essage", "[playerid] [message]");
if(strlen(message) > 128) return Error(playerid, "Your message cannot be longer than 128 characters.");
if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
//new string[128];
format(STRING, "Admin message from %s: %s", GetPlayerNameEx(playerid), message);
SendClientMessageEx(toid, COLOR_GREEN, string);
format(STRING, "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
SendAdminMessage(COLOR_GREEN,string);
Log("logs/adminmessage.log", string);
PlayerInfo[playerid][pAMSSent] ++;
}
else
{
new message[80];
if(sscanf(params, "s[80]", message)) return Syntax(playerid, "[a]dmin[m]essage", "[message]");
if(strlen(message) > 80) return Error(playerid, "Your message cannot be longer than 80 characters.");
//if(strfind(message, "Falling", true) != -1) return Error(playerid, "Type (/falling) and a administrative person will be there to assist you right away!");
//new string[128];
format(STRING, "Admin message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
SendAdminMessage(COLOR_GREEN,string);
format(STRING, "Your message, %s, has been sent.", message);
SendClientMessageEx(playerid, COLOR_GREEN, string);
format(STRING, "Player %s [%d] > Admins: %s", GetPlayerNameEx(playerid), playerid, message);
Log("logs/adminmessage.log", string);
}
return 1;
}
if(NewbieTimer[playerid] >= 1) { format(string, sizeof(string), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]); SendClientMessageEx(playerid, COLOR_GREY, string); return 1; } |
if(PlayerInfo[playerid][pHelper]< 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 15;
}
if(PlayerInfo[playerid][pHelper] >= 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 5;
}
if(IsAdmin(playerid))
{
NewbieTimer[playerid] = 0;
}
if(NewbieTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
SendClientMessageEx(playerid, COLOR_GREY, string);
return 1;
}
if(NewbieTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
SendClientMessageEx(playerid, COLOR_GREY, string);
return 1;
}
if(PlayerInfo[playerid][pHelper]< 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 15;
}
if(PlayerInfo[playerid][pHelper] >= 1 && PlayerInfo[playerid][pAdmin] < 1)
{
NewbieTimer[playerid] = 5;
}
if(IsAdmin(playerid))
{
NewbieTimer[playerid] = 0;
}
if(NewbieTimer[playerid])
{
new numstring[60];
format(numstring, sizeof(numstring), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
return SendClientMessageEx(playerid, COLOR_GREY, numstring);
}
NewbieTimer[playerid] = (PlayerInfo[playerid][pAdmin]) ? (0) : ((PlayerInfo[playerid][pHelper]) ? (5) : (15));
CMD:am(playerid, params[])
{
if(!gPlayerLogged{playerid}) return SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
if(!PlayerInfo[playerid][pTut]) return SendClientMessageEx(playerid, COLOR_GREY, "You can't do that at this time.");
if(PlayerInfo[playerid][pAmute]) return SendClientMessageEx(playerid, COLOR_RED, "You are muted from using /am!");
if(noam == 1 && !PlayerInfo[playerid][pAdmin]) return SendClientMessageEx(playerid, COLOR_GRAD2, " The Admin Message System has been disabled by an adminstrator, try again later.");
if(NewbieTimer[playerid])
{
new numstring[60];
format(numstring, sizeof(numstring), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
return SendClientMessageEx(playerid, COLOR_GREY, numstring);
}
NewbieTimer[playerid] = (PlayerInfo[playerid][pAdmin]) ? (0) : ((PlayerInfo[playerid][pHelper]) ? (5) : (15));
if(IsAdmin(playerid))
{
new toid, message[128];
if(sscanf(params, "is[128]", toid, message)) return Syntax(playerid, "[a]dmin[m]essage", "[playerid] [message]");
if(strlen(message) > 128) return Error(playerid, "Your message cannot be longer than 128 characters.");
if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
//new string[128];
format(STRING, "Admin message from %s: %s", GetPlayerNameEx(playerid), message);
SendClientMessageEx(toid, COLOR_GREEN, string);
format(STRING, "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
SendAdminMessage(COLOR_GREEN,string);
Log("logs/adminmessage.log", string);
PlayerInfo[playerid][pAMSSent] ++;
}
else
{
new message[80];
if(sscanf(params, "s[80]", message)) return Syntax(playerid, "[a]dmin[m]essage", "[message]");
if(strlen(message) > 80) return Error(playerid, "Your message cannot be longer than 80 characters.");
//if(strfind(message, "Falling", true) != -1) return Error(playerid, "Type (/falling) and a administrative person will be there to assist you right away!");
//new string[128];
format(STRING, "Admin message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
SendAdminMessage(COLOR_GREEN,string);
format(STRING, "Your message, %s, has been sent.", message);
SendClientMessageEx(playerid, COLOR_GREEN, string);
format(STRING, "Player %s [%d] > Admins: %s", GetPlayerNameEx(playerid), playerid, message);
Log("logs/adminmessage.log", string);
}
return 1;
}
if(gPlayerLogged{playerid} == 0)
if(NewbieTimer[playerid] > 0)
{
format(string, sizeof(string), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
I know the issue was probably resolved, but can someone explain this to me:
pawn Код:
|
"Char-arrays"
PAWN has a feature for accessing single bytes in arrays, intended for use with packed strings. Most SA-MP natives doesn't cover packed strings, though. |