Random Cmd messages
#1

Код:
if (strcmp("/Mysterybox", cmdtext, true, 10) == 0)

	if (GetPlayerMoney(playerid) < 100)
		{
		SendClientMessage(playerid, 0xFFAE1CFF, "You Dont Have Enough Money To Bomb the North East bridge you need $4000");
		return 1;
	}
	else
	{
	    switch(random(3))
		case 0: SendClientMessage(playerid, 0xFFAE1CFF, " 3 Kills = Thermal Goggles");
		case 1: SendClientMessage(playerid, 0xFFAE1CFF, " BOO");
		case 2: SendClientMessage(playerid, 0xFFAE1CFF, " PIGZ");
		return 1;
	}
(464) : error 001: expected token: "{", but found "case"
(467) : error 002: only a single statement (or expression) can follow each "case"
(467) : warning 215: expression has no effect

The messages are a bit random but I am using them for testing what seems to be wrong?
Reply
#2

try like this :
pawn Код:
if (strcmp("/Mysterybox", cmdtext, true, 10) == 0)
{

if (GetPlayerMoney(playerid) < 100)
{
SendClientMessage(playerid, 0xFFAE1CFF, "You Dont Have Enough Money To Bomb the North East bridge you need $4000");

}
else
{
 switch(random(3))
case 0: SendClientMessage(playerid, 0xFFAE1CFF, " 3 Kills = Thermal Goggles");
case 1: SendClientMessage(playerid, 0xFFAE1CFF, " BOO");
case 2: SendClientMessage(playerid, 0xFFAE1CFF, " PIGZ");
}
}
return 1;
}
Reply
#3

pawn Код:
if (strcmp("/mysterybox", cmdtext, true, 10) == 0)
{
    if (GetPlayerMoney(playerid) < 100)
        return SendClientMessage(playerid, 0xFFAE1CFF, "You Dont Have Enough Money To Bomb the North East bridge you need $4000");

    switch(random(3))
    {
        case 0: SendClientMessage(playerid, 0xFFAE1CFF, " 3 Kills = Thermal Goggles");
        case 1: SendClientMessage(playerid, 0xFFAE1CFF, " BOO");
        case 2: SendClientMessage(playerid, 0xFFAE1CFF, " PIGZ");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)