if(!strcmp(sub_cmd, "joinmsg"))
{
switch (Player[playerid][JoinMsg])
{
case 0:
{
Player[playerid][JoinMsg] = 1;
SCM(playerid, COLOR_YELLOW, "* You have enabled join messages.");
}
case 1:
{
Player[playerid][JoinMsg] = 0;
SCM(playerid, COLOR_YELLOW, "* You have disabled join messages.");
}
}
}
|
Why further reduce the code? Not because it's shorter means it's faster.
replaces "if(!strcmp(sub_cmd, "joinmsg"))" with "if(!strcmp(sub_cmd, "joinmsg", true))" |
replaces "if(!strcmp(sub_cmd, "joinmsg"))" with "if(!strcmp(sub_cmd, "joinmsg", true))"
if(!strcmp(sub_cmd, "joinmsg"))
{
switch (Player[playerid][JoinMsg])
{
case 0:
{
Player[playerid][JoinMsg] = 1;
SCM(playerid, COLOR_YELLOW, "* You have enabled join messages.");
}
case 1:
{
Player[playerid][JoinMsg] = 0;
SCM(playerid, COLOR_YELLOW, "* You have disabled join messages.");
}
}
}
if(!strcmp(sub_cmd, "joinmsg"))
{
if(Player[playerid][JoinMsg])
{
Player[playerid][JoinMsg] = 0;
SCM(playerid, COLOR_YELLOW, "* You have disabled join messages.");
}
else
{
Player[playerid][JoinMsg] = 1;
SCM(playerid, COLOR_YELLOW, "* You have enabled join messages.");
}
}
if(!strcmp(sub_cmd, "joinmsg"))
{
Player[playerid][JoinMsg] = !Player[playerid][JoinMsg];
if(Player[playerid][JoinMsg])
{
SCM(playerid, COLOR_YELLOW, "* You have enabled join messages.");
}
else
{
SCM(playerid, COLOR_YELLOW, "* You have disabled join messages.");
}
}
if(!strcmp(sub_cmd, "joinmsg"))
{
if((Player[playerid][JoinMsg] = !Player[playerid][JoinMsg]))
{
SCM(playerid, COLOR_YELLOW, "* You have enabled join messages.");
}
else
{
SCM(playerid, COLOR_YELLOW, "* You have disabled join messages.");
}
}
if(!strcmp(sub_cmd, "joinmsg"))
{
SCM(playerid, COLOR_YELLOW, (Player[playerid][JoinMsg] = !Player[playerid][JoinMsg]) ? ("* You have enabled join messages.") : ("* You have disabled join messages."));
}
if(!strcmp(sub_cmd, "joinmsg")) SCM(playerid, COLOR_YELLOW, (Player[playerid][JoinMsg] = !Player[playerid][JoinMsg]) ? ("* You have enabled join messages.") : ("* You have disabled join messages."));
if(!strcmp(sub_cmd, "joinmsg")){switch (Player[playerid][JoinMsg]){case 0:{Player[playerid][JoinMsg] = 1;SCM(playerid, COLOR_YELLOW, "* You have enabled join messages.");}case 1:{Player[playerid][JoinMsg] = 0;SCM(playerid, COLOR_YELLOW, "* You have disabled join messages.");}}}
|
its not in it.
i know it has been told somewhere but its not in it. |
|
It is, took me 10 seconds to confirm that - 9 of those just for downloading the file.
|