25.02.2009, 19:08
rks just forgot some = (dunno how to call them :S)
and a switch is easy
and a switch is easy
pawn Код:
switch(classid) //the value we want switch (much if statments just in a better looking way)
{
//this is the same as if(classid == 0)
case 0: GameTextForPlayer(playerid, "Police Chef", 1000, 6);
case 1: GameTextForPlayer(playerid, "Federal Agents - Leader", 1000, 6);
case 2: GameTextForPlayer(playerid, "La Costra Nostra - Leader", 1000, 6);
case 3: GameTextForPlayer(playerid, "Hitman - Leader", 1000, 6);
case 4: GameTextForPlayer(playerid, "Da Nang Boys - Leader", 1000, 6);
//the two points stand for 5-8 (5, 6, 7, 8) here you can write 5, 6, 7, 8 too but .. is easier
case 5..8: GameTextForPlayer(playerid, "Police", 1000, 4);
case 9..12: GameTextForPlayer(playerid, "Federal Agents", 1000, 4);
case 13..16: GameTextForPlayer(playerid, "La Costra Nostra Family", 1000, 4);
case 17..20: GameTextForPlayer(playerid, "Hitman", 1000, 4);
case 21..23: GameTextForPlayer(playerid, "Da Nang Boys", 1000, 4);
//default is the same as else (all other classids which you didnt used)
default: GameTextForPlayer(playerid, "Undefined Class", 1000, 4);
}