ERROR: Must be assigned to an array | with random messages
#7

I am still getting the errors, this is my full script for it:
Top of script
pawn Code:
new randomAnswer[4][128] = {
{"Movie server lives!"},
{"Cobra is a hoe!"},
{"Mr.Beer is a hoe!"},
{"Sh4d0w is a hoe!"}
};
new randomMoney[5][1]= {
{4000},
{2000},
{100},
{10000},
{1}
};
new ContestAnswer;
new CONTEST_PRIZE;
The forwards
pawn Code:
Using NewContest();
Using OnPlayerWinContest(playerid);
OnGameModeInit
pawn Code:
SetTimer("NewContest",(1000*60*CONTESTTIME),1);
OnPlayerText
pawn Code:
if(strval(text) == ContestAnswer)
{
OnPlayerWinContest(playerid);
}
NewContest
pawn Code:
public NewContest()
{
    new string[256];
    strmid(ContestAnswer,randomAnswer[rand],0,strlen(randomAnswer[rand]),255);
    format(string,sizeof(string),"The first person to type '%s' first, wins $%d.",ContestAnswer[rand],CONTEST_PRIZE);
    SendClientMessageToAll(COLOR_CONTEST,string);
    return 1;
}
OnPlayreWinContest
pawn Code:
public OnPlayerWinContest(playerid)
{
    new pName[MAX_PLAYER_NAME],string[128]; // A pName variable for the player's name, and a string to output.
    GetPlayerName(playerid,pName,sizeof pName); //Get's the player's name.
    format(string,sizeof string,"Player %s has won the contest and has won %d!",pName,CONTEST_PRIZE);
    SendClientMessageToAll(0x00FFFFFF,string); //Same color, and it outputs a string.
    GivePlayerMoney(playerid,CONTEST_PRIZE);
    ContestAnswer = -1;
    return 1;
}
Ok so now using all that when compiling pawncc crashes.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)