Random
#1

I just want to change the TextDraw string to random... Cargo or Passengers
but i will get erros... because the

pawn Код:
case 0: "Passengers"
Any ideas on how i can do it? :i

pawn Код:
COMMAND:job(playerid, params[])
{
    new string[128];
    new rand1 = random(4);
    switch(rand1)
    {
        case 0: "Passengers"
        case 1: "Cargo"
        case 3: "Passengers"
        case 4: "Cargo"
    }
    TextDrawShowForPlayer(playerid, TruckerInfo[playerid]);
    format(string, sizeof(string), "Transport need to transport %s", rand1);
    TextDrawSetString(TruckerInfo[playerid] ,string);
    return 1;
}
Reply
#2

pawn Код:
COMMAND:job(playerid, params[])
{
    new
        iStr[60],
        iRandMsg[15];

    switch(random(4))
    {
        case 0: iRandMsg = "Passengers";
        case 1: iRandMsg = "Cargo";
        case 2: iRandMsg = "Passengers";
        case 3: iRandMsg = "Cargo";
    }

    TextDrawShowForPlayer(playerid, TruckerInfo[playerid]);
    format(iStr, sizeof(iStr), "Transport need to transport %s", iRandMsg);
    TextDrawSetString(TruckerInfo[playerid], iStr);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)