format(string, sizeof(string), "[AFK] %s [AFK]", Playerid); new Text3D:label = Create3DTextLabel(string, COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0, 0); Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
new afk[MAX_PLAYERS];
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
SetTimer("AFKTimer", 1000, 1);
return 1;
}
forward AFKTimer();
public AFKTimer()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
afk[i]++;
if (afk[i] % 30 == 0)
{
new msg[60];
format(msg, 59, "player %d is afk for %d seconds now!", i, afk[i]);
SendClientMessageToAll(0xFFFFFF00, msg);
}
}
}
}
public OnPlayerUpdate(playerid)
{
afk[playerid] = 0;
return 1;
}
public OnPlayerUpdate(playerid) { format(string, sizeof(string), "[AFK] %s [AFK]", Playerid); new Text3D:label = Create3DTextLabel(string, 0xFF0000FF, 30.0, 40.0, 50.0, 40.0, 0, 0); Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7); return 1; }
G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(545) : error 017: undefined symbol "string" G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(545) : error 017: undefined symbol "string" G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(545) : error 029: invalid expression, assumed zero G:\NpTDM[0.3e]\gamemodes\NpTDM.pwn(545) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
//Where you create all your variables new stringAFK[17]; public OnPlayerUpdate(playerid) { format(stringAFK, sizeof(stringAFK), "[AFK] %d [AFK]", playerid); new Text3D:label = Create3DTextLabel(stringAFK, 0xFF0000FF, 30.0, 40.0, 50.0, 40.0, 0, 0); Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7); return 1; }
Код:
//Where you create all your variables new stringAFK[16]; public OnPlayerUpdate(playerid) { format(stringAFK, sizeof(stringAFK), "[AFK] %d [AFK]", playerid); new Text3D:label = Create3DTextLabel(stringAFK, 0xFF0000FF, 30.0, 40.0, 50.0, 40.0, 0, 0); Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7); return 1; } |