VC:MP 0.4 (Beta) > Script Discussion

Starting server problem

(1/2) > >>

Maxximizer:
Hi guys. Need you help.
When i'm starting my script, console says:


Line 2617
else if (!IsNum(tmp[1] || tmp[1].tointeger() < 1 || tmp[1].tointeger() > 5) ClientMessage("Enter: /c setrank [Nick] [1-5]", player, 255, 0, 0);

All code
else if (cmd == "setrank")
{
if (PlayerInfo[playerid].Logged == 0) ClientMessage("You are not log in!", player, 255, 0, 0);
else if (!IsPlayerExistsClan(player)) ClientMessage("You have not clan!", player, 255, 0, 0);
else if (!text) ClientMessage("Enter: /c setrank [Nick] [1-5]", player, 255, 0, 0);
else if (GetPlayerDetailsValue(player, "clan_rank") < 3) ClientMessage("You need clan rank [3]", player, 255, 0, 0);
else
{
local tmp = split(text, " "); //&#1056;&#1072;&#1079;&#1073;&#1080;&#1074;&#1072;&#1077;&#1084; &#1080;&#1089;&#1093;&#1086;&#1076;&#1085;&#1091;&#1102; &#1082;&#1086;&#1084;&#1072;&#1085;&#1076;&#1091; &#1087;&#1086; &#1087;&#1088;&#1086;&#1073;&#1077;&#1083;&#1072;&#1084; &#1080; &#1087;&#1080;&#1096;&#1077;&#1084; &#1074; &#1084;&#1072;&#1089;&#1089;&#1080;&#1074; cmd
if (tmp.len() != 2) ClientMessage("Enter: /c setrank [Nick] [1-5]", player, 255, 0, 0);
else if ( !IsClanRegistered(tmp[0]) ) ClientMessage("This clan does not exists", player, 255, 0, 0);
else if (!IsNum(tmp[1] || tmp[1].tointeger() < 1 || tmp[1].tointeger() > 5) ClientMessage("Enter: /c setrank [Nick] [1-5]", player, 255, 0, 0);
else
{
SetPlayerDetailsValue(player, "clan_rank", tmp[1].tointeger() );

msg = format("%s [%i] set clan rank: [%i]", player.Name, GetPlayerLevel(player), tmp[1].tointeger() );
ClientMessage(msg, player, 255, 0, 0);
}
}
}
Please help me, i'm beginner

heekz.shadow:
Which is line 2617 ?

Maxximizer:

--- Quote from: heekz.shadow on September 20, 2014, 10:59:00 pm ---Which is line 2617 ?

--- End quote ---
Line 2617
else if (!IsNum(tmp[1] || tmp[1].tointeger() < 1 || tmp[1].tointeger() > 5) ClientMessage("Enter: /c setrank [Nick] [1-5]", player, 255, 0, 0);

Maxximizer:
p.s. Before use a 0.4 version, i'm use this script on 0.3z ver

heekz.shadow:
you forgot a ) after IsNum( tmp[1] )

replace it with:

else if (!IsNum(tmp[1]) || tmp[1].tointeger() < 1 || tmp[1].tointeger() > 5) ClientMessage("Enter: /c setrank [Nick] [1-5]", player, 255, 0, 0);

Navigation

[0] Message Index

[#] Next page

Go to full version