16.11.2009, 19:45
Well, I've been scripting my GM with YSI without any problems. But now I started to think about how 'else' must be scripted.
Can someone explain me the WHY I have to put else instead of else if
pawn Код:
Command_(kick)
{
if (help)
{
Text_Send(playerid, "KICK_HELP");
Text_SendFormat(playerid, "KICK_HELP1", "kick");
}
else
{
if (sscanf(params, "u", player))
{
Text_Send(playerid, "KICK_HELP");
Text_SendFormat(playerid, "KICK_HELP1", "kick");
}
else
{
if (IsPlayerConnected(player))
{
Kick(player);
Text_SendFormat(player, "YOURE_KICKED", ReturnPlayerName(playerid), playerid);
Text_SendToAllFormat("THEYRE_KICKED", ReturnPlayerName(player), player, ReturnPlayerName(playerid), playerid);
}
else
{
Text_SendFormat(playerid, "NOT_CONNECTED", player);
}
}
}
return 1;
}