Red Screen
#1

Hello,

I wanted if you get shot your screen will be red for 2 seconds or more.
Is that possible?

Thanks!
Reply
#2

This can be made, but assuming you want it readily, here's one (really old):
https://sampforum.blast.hk/showthread.php?pid=540008#pid540008
Reply
#3

Can someone give me a code? I'm not that pro in pawno haha

If someone shoots 1 bullet the red screen will appear with a transparent, not in fade just a red screen for 1 sec.
Reply
#4

Bump.
Reply
#5

pawn Код:
//Put this under the includes
new PlayerText:Textdraw0[MAX_PLAYERS];
pawn Код:
//Put this under OnPlayerConnect
Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 678.800048, 0.753333, "usebox");
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.000000, 49.458148);
PlayerTextDrawTextSize(playerid, Textdraw0[playerid], -5.199999, 0.000000);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 102);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);
pawn Код:
//Add this on the bottom of your script.
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    PlayerTextDrawShow(playerid,Textdraw0[playerid]);
    SetTimerEx("DamageDrawHide",500,0,"i",playerid);
    return 1;
}
forward DamageDrawHide(playerid);
public DamageDrawHide(playerid)
{
    PlayerTextDrawHide(playerid,Textdraw0[playerid]);
}
Reply
#6

Код:
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(386) : error 021: symbol already defined: "Textdraw0"
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(1064) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4067) : error 033: array must be indexed (variable "Textdraw0")
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4068) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4069) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4070) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4071) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4072) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4073) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4660) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(4914) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(9533) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(15741) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(19591) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(23841) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(24310) : error 035: argument type mismatch (argument 1)
C:\Users\Nourdin\Desktop\LSC-RP\gamemodes\LSC-RP.pwn(33467) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


17 Errors.
17 errors.
Reply
#7

Seems like you already had a textdraw with the same name
pawn Код:
//Put this under the includes
new PlayerText:DamageTextDraw[MAX_PLAYERS];
pawn Код:
//Put this under OnPlayerConnect
DamageTextDraw[playerid] = CreatePlayerTextDraw(playerid, 678.800048, 0.753333, "usebox");
PlayerTextDrawLetterSize(playerid, DamageTextDraw[playerid], 0.000000, 49.458148);
PlayerTextDrawTextSize(playerid, DamageTextDraw[playerid], -5.199999, 0.000000);
PlayerTextDrawAlignment(playerid, DamageTextDraw[playerid], 1);
PlayerTextDrawColor(playerid, DamageTextDraw[playerid], 0);
PlayerTextDrawUseBox(playerid, DamageTextDraw[playerid], true);
PlayerTextDrawBoxColor(playerid, DamageTextDraw[playerid], 102);
PlayerTextDrawSetShadow(playerid, DamageTextDraw[playerid], 0);
PlayerTextDrawSetOutline(playerid, DamageTextDraw[playerid], 0);
PlayerTextDrawFont(playerid, DamageTextDraw[playerid], 0);
pawn Код:
//Add this on the bottom of your script.
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    PlayerTextDrawShow(playerid,DamageTextDraw[playerid]);
    SetTimerEx("DamageDrawHide",500,0,"i",playerid);
    return 1;
}
forward DamageDrawHide(playerid);
public DamageDrawHide(playerid)
{
    PlayerTextDrawHide(playerid,DamageTextDraw[playerid]);
}
Reply
#8

Is it possible too if you fall from a building or someone attacks you with a fist that your HP will not be less? Only by shots or bats or w/e?
Reply
#9

Quote:
Originally Posted by Aarab
Посмотреть сообщение
Is it possible too if you fall from a building or someone attacks you with a fist that your HP will not be less? Only by shots or bats or w/e?
Yes it is, you could use OnPlayerTakeDamage for that
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid == INVALID_PLAYER_ID)//So this is incase the player that gave you damage is not connected, which means collision ect
    {
    new Float:HP;//We will use this Float variable to store the player's HP
    GetPlayerHealth(playerid, HP);//This will store the player's HP
    SetPlayerHealth(playerid,HP + amount);//We'll set the player's Health to the original one by adding the After damage health + the amount of damage
    }
    return 1;
}
Reply
#10

Thank you haha :P anyways the screen is changing to black and not red :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)