Код HTML:
/* Reklez's Player Info Textdraw [FS] Author: Reklez ©, 2012 */ #include <a_samp> #include <zcmd> #define PLAYERS 200 new PlayerText:Name[MAX_PLAYERS]; new bool:loggedFirstTime[MAX_PLAYERS]; new Float:health, Float:armour, Text:PHealth[MAX_PLAYERS], Text:PArmour[MAX_PLAYERS], Text:PPing[MAX_PLAYERS], Text:PCash[MAX_PLAYERS], Text:PScore[MAX_PLAYERS]; #if defined FILTERSCRIPT #else public OnFilterScriptInit() { print("\nReklez's Playerinfo Textdraw [FS], © 2012\n"); return 1; } public OnFilterScriptExit() { print("\nReklez's Playerinfo Textdraw [FS] Unloaded, © 2012\n"); return 1; } #endif public OnPlayerConnect(playerid) { PHealth[playerid] = TextDrawCreate(182.000000,436.000000,"Vida:"); PArmour[playerid] = TextDrawCreate(243.000000,436.000000,"Colete:"); PPing[playerid] = TextDrawCreate(319.000000,436.000000,"Ping:"); PScore[playerid] = TextDrawCreate(499.000000,1.000000,"Mata Mata Brasileiro"); PCash[playerid] = TextDrawCreate(1.000000,436.000000," Text"); TextDrawAlignment(PHealth[playerid],0); TextDrawAlignment(PArmour[playerid],0); TextDrawAlignment(PPing[playerid],0); TextDrawAlignment(PScore[playerid],0); TextDrawAlignment(PCash[playerid],0); TextDrawBackgroundColor(PCash[playerid],0x000000ff); TextDrawFont(PCash[playerid],2); TextDrawLetterSize(PCash[playerid],0.199999,1.100000); TextDrawColor(PCash[playerid],0xffffffff); TextDrawSetOutline(PCash[playerid],1); TextDrawFont(PHealth[playerid],2); TextDrawLetterSize(PHealth[playerid],0.199999,1.100000); TextDrawFont(PArmour[playerid],2); TextDrawLetterSize(PArmour[playerid],0.199999,1.100000); TextDrawFont(PPing[playerid],2); TextDrawLetterSize(PPing[playerid],0.199999,1.100000); TextDrawFont(PScore[playerid],3); TextDrawLetterSize(PScore[playerid],0.299999,2.299999); TextDrawColor(PHealth[playerid],0xffffffff); TextDrawColor(PArmour[playerid],0xffffffff); TextDrawColor(PPing[playerid],0xffffffff); TextDrawColor(PScore[playerid],-16776961); TextDrawSetOutline(PHealth[playerid],1); TextDrawSetOutline(PArmour[playerid],1); TextDrawSetOutline(PPing[playerid],1); TextDrawSetOutline(PScore[playerid],1); TextDrawSetShadow(PHealth[playerid],1); TextDrawSetShadow(PArmour[playerid],1); TextDrawSetShadow(PPing[playerid],1); TextDrawSetShadow(PScore[playerid],1); TextDrawUseBox(PHealth[playerid],1); TextDrawBoxColor(PHealth[playerid],0x000000cc); TextDrawTextSize(PHealth[playerid],240.000000,0.000000); TextDrawBackgroundColor(PHealth[playerid],0x000000ff); TextDrawSetShadow(PHealth[playerid],1); TextDrawSetProportional(PHealth[playerid],1); TextDrawUseBox(PArmour[playerid],1); TextDrawBoxColor(PArmour[playerid],0x000000cc); TextDrawTextSize(PArmour[playerid],315.000000,0.000000); TextDrawBackgroundColor(PArmour[playerid],0x000000ff); TextDrawSetShadow(PArmour[playerid],1); TextDrawSetProportional(PArmour[playerid],1); TextDrawUseBox(PPing[playerid],1); TextDrawBoxColor(PPing[playerid],0x000000cc); TextDrawTextSize(PPing[playerid],371.000000,0.000000); TextDrawBackgroundColor(PPing[playerid],0x000000ff); TextDrawSetProportional(PPing[playerid],1); TextDrawSetShadow(PPing[playerid],1); TextDrawBackgroundColor(PScore[playerid],0xFFFFFFFF); TextDrawSetProportional(PScore[playerid],1); TextDrawUseBox(PCash[playerid],1); TextDrawBoxColor(PCash[playerid],0x000000cc); TextDrawTextSize(PCash[playerid],178.000000,0.000000); TextDrawSetOutline(PCash[playerid],1); TextDrawSetProportional(PCash[playerid],1); TextDrawSetShadow(PCash[playerid],1); loggedFirstTime[playerid] = true; Name[playerid] = CreatePlayerTextDraw(playerid, 497.000000,436.000000," "); PlayerTextDrawBackgroundColor(playerid, Name[playerid], 0x000000ff); PlayerTextDrawFont(playerid, Name[playerid], 2); PlayerTextDrawLetterSize(playerid, Name[playerid],0.199999,1.100000); PlayerTextDrawColor(playerid, Name[playerid], 0xffffffff); PlayerTextDrawSetOutline(playerid, Name[playerid], 1); PlayerTextDrawSetProportional(playerid, Name[playerid], 1); PlayerTextDrawSetShadow(playerid, Name[playerid],1); PlayerTextDrawUseBox(playerid, Name[playerid],1); PlayerTextDrawBoxColor(playerid, Name[playerid],0x000000cc); PlayerTextDrawTextSize(playerid, Name[playerid],638.000000,0.000000); PlayerTextDrawAlignment(playerid, Name[playerid],0); new playerName[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME + 10]; GetPlayerName(playerid, playerName, sizeof(playerName)); format(str, sizeof(str), "~w~Nick: ~r~%s", playerName); PlayerTextDrawSetString(playerid, Name[playerid], str); return 1; } public OnPlayerDisconnect(playerid, reason) { TextDrawHideForPlayer(playerid, PHealth[playerid]); TextDrawHideForPlayer(playerid, PArmour[playerid]); TextDrawHideForPlayer(playerid, PPing[playerid]); TextDrawHideForPlayer(playerid, PScore[playerid]); TextDrawHideForPlayer(playerid, PCash[playerid]); return 1; } public OnPlayerSpawn(playerid) { TextDrawShowForPlayer(playerid, PHealth[playerid]); TextDrawShowForPlayer(playerid, PArmour[playerid]); TextDrawShowForPlayer(playerid, PPing[playerid]); TextDrawShowForPlayer(playerid, PScore[playerid]); TextDrawShowForPlayer(playerid, PCash[playerid]); if(loggedFirstTime[playerid]) { loggedFirstTime[playerid] = false; PlayerTextDrawShow(playerid, Name[playerid]); } return 1; } COMMAND:pnhaoff(playerid,params[]) { PlayerTextDrawHide(playerid, Name[playerid]); return 1; } public OnPlayerUpdate(playerid) { new InfoString[300]; if(IsPlayerConnected(playerid)) { if(IsPlayerNPC(playerid)) return 0; GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); new ping = GetPlayerPing(playerid); new score = GetPlayerScore(playerid); new cash = GetPlayerMoney(playerid); format(InfoString, sizeof(InfoString), "VIDA: ~r~%.1f", health); TextDrawSetString(PHealth[playerid], InfoString); format(InfoString, sizeof(InfoString), "Colete: ~r~%.1f", armour); TextDrawSetString(PArmour[playerid], InfoString); format(InfoString, sizeof(InfoString), "Ping: ~r~%d", ping); TextDrawSetString(PPing[playerid], InfoString); format(InfoString, sizeof(InfoString), "~l~Mata Mata Brasileiro", score); TextDrawSetString(PScore[playerid], InfoString); format(InfoString, sizeof(InfoString), " ~r~] ~w~Mata Mata Brasileiro ~r~]", cash); TextDrawSetString(PCash[playerid], InfoString); } return 1; } |
//======------TOPO---------//
new PlayerText:MyName;
//======--------===========//
public OnPlayerConnect(playerid)//
{
MyName[playerid] = CreatePlayerTextDraw(playerid, 497.000000,436.000000,"Hello Wolrd");
PlayerTextDrawBackgroundColor(playerid, MyName[playerid], 0x000000ff);
PlayerTextDrawFont(playerid, MyName[playerid], 2);
PlayerTextDrawLetterSize(playerid, MyName[playerid],0.199999,1.100000);
PlayerTextDrawColor(playerid, MyName[playerid], 0xffffffff);
PlayerTextDrawSetOutline(playerid, MyName[playerid], 1);
PlayerTextDrawSetProportional(playerid, MyName[playerid], 1);
PlayerTextDrawSetShadow(playerid, MyName[playerid],1);
PlayerTextDrawUseBox(playerid, MyName[playerid],1);
PlayerTextDrawBoxColor(playerid, MyName[playerid],0x000000cc);
PlayerTextDrawTextSize(playerid, MyName[playerid],638.000000,0.000000);
PlayerTextDrawAlignment(playerid, MyName[playerid],0);
new newtext[41], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(newtext, sizeof(newtext), "~g~Nick: ~w~%s", name);
PlayerTextDrawSetString(MyName, newtext);
PlayerTextDrawShowForPlayer(playerid, MyName);
return 1;
}
PHP код:
|
Coloquei do geito que voce me mando mais deu esses ERROS:
C:\Users\Max\Desktop\0.3.7 R2\gamemodes\MataMataBR.pwn(6629) : error 028: invalid subscript (not an array or too many subscripts): "MyName" C:\Users\Max\Desktop\0.3.7 R2\gamemodes\MataMataBR.pwn(6629) : warning 215: expression has no effect C:\Users\Max\Desktop\0.3.7 R2\gamemodes\MataMataBR.pwn(6629) : error 001: expected token: ";", but found "]" C:\Users\Max\Desktop\0.3.7 R2\gamemodes\MataMataBR.pwn(6629) : error 029: invalid expression, assumed zero C:\Users\Max\Desktop\0.3.7 R2\gamemodes\MataMataBR.pwn(6629) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
new PlayerText:MyName[MAX_PLAYERS];
o "iTakelot" passou um code errado, coloca assim!
PHP код:
|