PDA

View Full Version : Hns Admin Menu


Kashen
02-05-2013, 10:17
delete plz....

didoWEE
02-05-2013, 12:27
You can fix much of your code. You must know this:

switch(Style[id]) {
case 1: BanPlayer(id) // Ban}

switch(Style[id]) {
case 2: SlayPlayer(id) // Slay}

switch(Style[id]) {
case 3: RevivePlayer(id) // Revive}

switch(Style[id]) {
case 4: KickPlayer(id) // Kick}

switch(Style[id]) {
case 5: SlapPlayer(id) // Slap}
}-->switch(Style[id])
{
case 1: BanPlayer(id);
case 2: SlayPlayer(id);
case 3: RevivePlayer(id);
case 4: KickPlayer(id);
case 5: SlapPlayer(id);
}and


if(cs_get_user_team(id) == CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_CT)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
if(!(cs_get_user_team(id) == CS_TEAM_T))
{
cs_set_user_team(id, CS_TEAM_T)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
-->
if(cs_get_user_team(id) == CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_CT)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
else if(cs_get_user_team(id) != CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_T)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}


// OR YOU CAN MAKE THIS

new CsTeams:team = cs_get_user_team(id);

if(team == CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_CT)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
else if(team != CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_T)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}

Napoleon_be
02-05-2013, 12:39
This will most likely get unapproved. But like didowee said, you can improve your code a lot. It doesn't mean if your plugin is unapproved, it doesn't allow you to edit it!

Kashen
02-05-2013, 12:39
You can fix much of your code. You must know this:

switch(Style[id]) {
case 1: BanPlayer(id) // Ban}

switch(Style[id]) {
case 2: SlayPlayer(id) // Slay}

switch(Style[id]) {
case 3: RevivePlayer(id) // Revive}

switch(Style[id]) {
case 4: KickPlayer(id) // Kick}

switch(Style[id]) {
case 5: SlapPlayer(id) // Slap}
}-->switch(Style[id])
{
case 1: BanPlayer(id);
case 2: SlayPlayer(id);
case 3: RevivePlayer(id);
case 4: KickPlayer(id);
case 5: SlapPlayer(id);
}and


if(cs_get_user_team(id) == CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_CT)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
if(!(cs_get_user_team(id) == CS_TEAM_T))
{
cs_set_user_team(id, CS_TEAM_T)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
-->
if(cs_get_user_team(id) == CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_CT)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
else if(cs_get_user_team(id) != CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_T)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}


// OR YOU CAN MAKE THIS

new CsTeams:team = cs_get_user_team(id);

if(team == CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_CT)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}
else if(team != CS_TEAM_T)
{
cs_set_user_team(id, CS_TEAM_T)
ExecuteHamB(Ham_CS_RoundRespawn, tempid)
}


Thanks ill fix it