09.02.2015, 23:21
Estou com error de compilar
PHP код:
: error 017: undefined symbol "Textdraw0"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
pawn Код:
new Text:Textdraw[6][MAX_PLAYERS];
]main()
{
print("\n----------------------------------");
print("Iniciado");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetTimer("UpdateTimer", 1000, true);
SetGameModeText("My Gaemode");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
Textdraw0[playerid] = TextDrawCreate(641.375000, 429.666687, "usebox");
TextDrawLetterSize(Textdraw0, 0.000000, 1.822222);
TextDrawTextSize(Textdraw0, -2.000000, 0.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, 0);
TextDrawUseBox(Textdraw0, true);
TextDrawBoxColor(Textdraw0, 102);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawFont(Textdraw0, 0);
Textdraw1[playerid] = TextDrawCreate(4.375000, 429.916687, "SCORE:");
TextDrawLetterSize(Textdraw1, 0.449999, 1.600000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, -2139062017);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 1);
TextDrawBackgroundColor(Textdraw1, 51);
TextDrawFont(Textdraw1, 3);
TextDrawSetProportional(Textdraw1, 1);
Textdraw2[playerid] = TextDrawCreate(110.000000, 430.500030, "DINHEIRO:");
TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -2139062017);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 3);
TextDrawSetProportional(Textdraw2, 1);
Textdraw3[playerid] = TextDrawCreate(225.625000, 430.499969, "KILLS:");
TextDrawLetterSize(Textdraw3, 0.449999, 1.600000);
TextDrawAlignment(Textdraw3, 1);
TextDrawColor(Textdraw3, -2139062017);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 1);
TextDrawBackgroundColor(Textdraw3, 51);
TextDrawFont(Textdraw3, 3);
TextDrawSetProportional(Textdraw3, 1);
Textdraw4[playerid] = TextDrawCreate(314.375000, 430.500152, "DEATHS:");
TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, -2139062017);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 1);
TextDrawBackgroundColor(Textdraw4, 51);
TextDrawFont(Textdraw4, 3);
TextDrawSetProportional(Textdraw4, 1);
Textdraw5[playerid] = TextDrawCreate(415.625000, 429.916564, "FPS:");
TextDrawLetterSize(Textdraw5, 0.449999, 1.600000);
TextDrawAlignment(Textdraw5, 1);
TextDrawColor(Textdraw5, -2139062017);
TextDrawSetShadow(Textdraw5, 0);
TextDrawSetOutline(Textdraw5, 1);
TextDrawBackgroundColor(Textdraw5, 51);
TextDrawFont(Textdraw5, 3);
TextDrawSetProportional(Textdraw5, 1);
Textdraw6[playerid] = TextDrawCreate(488.125000, 429.333312, "PING:");
TextDrawLetterSize(Textdraw6, 0.449999, 1.600000);
TextDrawAlignment(Textdraw6, 1);
TextDrawColor(Textdraw6, -2139062017);
TextDrawSetShadow(Textdraw6, 0);
TextDrawSetOutline(Textdraw6, 1);
TextDrawBackgroundColor(Textdraw6, 51);
TextDrawFont(Textdraw6, 3);
TextDrawSetProportional(Textdraw6, 1);
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
for(new i=0;i<MAX_PLAYERS;i++)
TextDrawDestroy(i[playerid]);
return 1;
}
public OnPlayerSpawn(playerid)
{
for(new i=0;i<MAX_PLAYERS;i++)
TextDrawShowForPlayer(playerid, i[playerid]);
return 1;
}
pawn Код:
forward UpdateTimer(); //Must always forward a timer, read the set timer topic in the wiki for more info.
public UpdateTimer() // Must be a public.
{
for(new x; x<MAX_PLAYERS; x++) // Loop for all players
{
if(!IsPlayerConnected(x));
Score = GetPlayerScore(x), Money = GetPlayerMoney(x), Ping = GetPlayerPing(x);
new TDstring[150];
format(TDstring, sizeof(TDstring), "SCORE %d, DINHEIRO %d, KILLS %d, DEATHS %d, FPS %d, PING %d", Score, Money, Ping);
TextDrawSetString(Textdraw0[x], TDstring);
}
return 1;
}