Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- forward timerforshotimg();
- new Text:PlayerInfoText0[MAX_PLAYERS];
- new Text:PlayerInfoText1[MAX_PLAYERS];
- new Text:PlayerInfoText2[MAX_PLAYERS];
- new PlayerInfoTextStatus[MAX_PLAYERS];
- new PlayerInfoTextTime[MAX_PLAYERS];
- new DamagePlayrID[MAX_PLAYERS];
- new MyName[MAX_PLAYERS][MAX_PLAYER_NAME];
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- //-----------------------------------------------------------
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(PlayerInfoTextStatus[issuerid] == 0)
- {
- PlayerInfoTextStatus[issuerid] = 2;
- TextDrawShowForPlayer(issuerid, PlayerInfoText0[issuerid]);
- TextDrawShowForPlayer(issuerid, PlayerInfoText1[issuerid]);
- TextDrawShowForPlayer(issuerid, PlayerInfoText2[issuerid]);
- }
- else if(PlayerInfoTextStatus[issuerid] == 1)
- {
- TextDrawShowForPlayer(issuerid, PlayerInfoText0[issuerid]);
- }
- PlayerInfoTextTime[issuerid] = 10;
- DamagePlayrID[issuerid] = playerid;
- new strdmg[25];
- new dmg = floatround( amount );
- format(strdmg, sizeof(strdmg), "~r~+%d ~w~dmg!",dmg);
- TextDrawSetString(PlayerInfoText0[issuerid], strdmg);
- new strname[30];
- format(strname, sizeof(strname), "~w~%s",MyName[playerid]);
- TextDrawSetString(PlayerInfoText1[issuerid], strname);
- new Float:health;
- GetPlayerHealth(playerid, health);
- new hp = floatround( health );
- new Float:armor;
- GetPlayerArmour(playerid, armor);
- new arm = floatround( armor );
- new gunname[32];
- GetWeaponName(GetPlayerWeapon(playerid),gunname,sizeof(gunname));
- new strinfo[128];
- format(strinfo, sizeof(strinfo), "~w~HP: ~y~%d~n~~w~Armor: ~y~%d~n~~w~Ping: ~y~%d ~y~ms~n~~w~Gun: ~y~%s",hp,arm,GetPlayerPing(playerid),gunname);
- TextDrawSetString(PlayerInfoText2[issuerid], strinfo);
- }
- //-----------------------------------------------------------
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- GetPlayerName(playerid, MyName[playerid],MAX_PLAYER_NAME);
- PlayerInfoTextStatus[playerid] = 0;PlayerInfoTextTime[playerid] = 0;DamagePlayrID[playerid] = -1;
- PlayerInfoText0[playerid] = TextDrawCreate(414.000000, 320.000000, "Loading...");
- TextDrawBackgroundColor(PlayerInfoText0[playerid], 255);
- TextDrawFont(PlayerInfoText0[playerid], 1);
- TextDrawLetterSize(PlayerInfoText0[playerid], 1.000000, 2.000000);
- TextDrawColor(PlayerInfoText0[playerid], -1);
- TextDrawSetOutline(PlayerInfoText0[playerid], 0);
- TextDrawSetProportional(PlayerInfoText0[playerid], 1);
- TextDrawSetShadow(PlayerInfoText0[playerid], 1);
- TextDrawSetSelectable(PlayerInfoText0[playerid], 0);
- PlayerInfoText1[playerid] = TextDrawCreate(400.000000, 343.000000, "Loading...");
- TextDrawBackgroundColor(PlayerInfoText1[playerid], 255);
- TextDrawFont(PlayerInfoText1[playerid], 1);
- TextDrawLetterSize(PlayerInfoText1[playerid], 1.000000, 2.000000);
- TextDrawColor(PlayerInfoText1[playerid], -1);
- TextDrawSetOutline(PlayerInfoText1[playerid], 0);
- TextDrawSetProportional(PlayerInfoText1[playerid], 1);
- TextDrawSetShadow(PlayerInfoText1[playerid], 1);
- TextDrawSetSelectable(PlayerInfoText1[playerid], 0);
- PlayerInfoText2[playerid] = TextDrawCreate(403.000000, 364.000000, "Loading...");
- TextDrawBackgroundColor(PlayerInfoText2[playerid], 255);
- TextDrawFont(PlayerInfoText2[playerid], 1);
- TextDrawLetterSize(PlayerInfoText2[playerid], 0.500000, 1.000000);
- TextDrawColor(PlayerInfoText2[playerid], -1);
- TextDrawSetOutline(PlayerInfoText2[playerid], 0);
- TextDrawSetProportional(PlayerInfoText2[playerid], 1);
- TextDrawSetShadow(PlayerInfoText2[playerid], 1);
- TextDrawUseBox(PlayerInfoText2[playerid], 1);
- TextDrawBoxColor(PlayerInfoText2[playerid], 842150450);
- TextDrawTextSize(PlayerInfoText2[playerid], 594.000000, 0.000000);
- TextDrawSetSelectable(PlayerInfoText2[playerid], 0);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawDestroy(PlayerInfoText0[playerid]);
- TextDrawDestroy(PlayerInfoText1[playerid]);
- TextDrawDestroy(PlayerInfoText2[playerid]);
- return 1;
- }
- public OnFilterScriptInit()
- {
- SetTimer("timerforshotimg", 1000, 1);
- return 1;
- }
- public timerforshotimg()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfoTextStatus[i] > 0)
- {
- if(PlayerInfoTextTime[i] > 0)
- {
- PlayerInfoTextTime[i]--;
- new damagedid = DamagePlayrID[i];
- if(PlayerInfoTextTime[i] == 6)
- {
- PlayerInfoTextStatus[i] = 1;
- TextDrawHideForPlayer(i, PlayerInfoText0[i]);
- }
- //-----------------------------------------------------------
- new strname[30];
- format(strname, sizeof(strname), "~w~%s",MyName[damagedid]);
- TextDrawSetString(PlayerInfoText1[i], strname);
- //-----------------------------------------------------------
- new Float:health;
- GetPlayerHealth(damagedid, health);
- new hp = floatround( health );
- new Float:armor;
- GetPlayerArmour(damagedid, armor);
- new arm = floatround( armor );
- new gunname[32];
- GetWeaponName(GetPlayerWeapon(damagedid),gunname,sizeof(gunname));
- new strinfo[128];
- format(strinfo, sizeof(strinfo), "~w~HP: ~y~%d~n~~w~Armor: ~y~%d~n~~w~Ping: ~y~%d ~y~ms~n~~w~Gun: ~y~%s",hp,arm,GetPlayerPing(damagedid),gunname);
- TextDrawSetString(PlayerInfoText2[i], strinfo);
- if(PlayerInfoTextTime[i] == 0)
- {
- PlayerInfoTextStatus[i] = 0;
- TextDrawHideForPlayer(i, PlayerInfoText0[i]);
- TextDrawHideForPlayer(i, PlayerInfoText1[i]);
- TextDrawHideForPlayer(i, PlayerInfoText2[i]);
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement