2 Questions [TextDraw Variable & baril explosion]
#1

Hey I have two Questions:

1-
pawn Код:
new Text:Textdraw10; //this is in the top
//the following code is under GameModInit
pawn Код:
Textdraw14 = TextDrawCreate(6.000000, 281.000000, "WELCOME TO THE SERVER!");
    TextDrawBackgroundColor(Textdraw14, 125);
    TextDrawFont(Textdraw14, 1);
    TextDrawLetterSize(Textdraw14, 0.58599, 0.48000);
    TextDrawColor(Textdraw14, 15489635);
    TextDrawSetOutline(Textdraw14, 2);
    TextDrawSetProportional(Textdraw14, 3);
//I have under OnPlayerConnect
Код:
TextDrawShowForPlayer(playerid,Textdraw14);
Will this show the textdraw for the new connected player or all ? (so need I to add [MAX_PLAYERS]; ?


2-I was wondering if a player putted a baril(can explode) , and then he shoot it , then 3 players die (near the baril) , Can the server detect that the player who shooted the baril is the killer ?


thank you.
Reply
#2

Its a global TD, so you dont need to use it per player, and nop barrels isny synced with samp
Reply
#3

so for bariles , I need to attach them to variables like Baril[playerid] = CreateObject(...)

how to Public onbarilexplose ?
Reply
#4

1. It's 'barrel'.
2. Object destruction isn't synced or detctable

You CAN detect if a player dies from a barrel, and possibly who caused it:

Under OnPlayerDeath, if reason == explosion (Id 54 I think, check the wiki), check if they are near a barrel (IsPlayerInRangeOfPoint) and when a player shoots (OnPlayerUpdate?) set a variable for the 'last shooter' to that player, that way you can find out who shot last, and they'll be the person that exploded the barrel.

Not 100% accurate but it's the best you can do.
Reply
#5

thanks ! gonna try it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)