08.03.2011, 23:15
Is there any way to use switch in
Example - Not like this:
But like this:
When i'm trying to use switch i got this error:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
pawn Код:
if(checkpointid == SerwerInfo[sCheckpoint][1]
|| checkpointid == SerwerInfo[sCheckpoint][2]
|| checkpointid == SerwerInfo[sCheckpoint][3]
|| checkpointid == SerwerInfo[sCheckpoint][4]
|| checkpointid == SerwerInfo[sCheckpoint][5]
|| checkpointid == SerwerInfo[sCheckpoint][6]
|| checkpointid == SerwerInfo[sCheckpoint][7])
{
pawn Код:
switch(checkpointid)
{
case SerwerInfo[sCheckpoint][1]:
{
SendClientMessage(playerid, COLOR_GREEN, "...");
}
}
Код:
error 008: must be a constant expression; assumed zero