21.07.2010, 08:31
I am still getting the errors, this is my full script for it:
Top of script
The forwards
OnGameModeInit
OnPlayerText
NewContest
OnPlayreWinContest
Ok so now using all that when compiling pawncc crashes.
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;
pawn Code:
Using NewContest();
Using OnPlayerWinContest(playerid);
pawn Code:
SetTimer("NewContest",(1000*60*CONTESTTIME),1);
pawn Code:
if(strval(text) == ContestAnswer)
{
OnPlayerWinContest(playerid);
}
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;
}
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;
}