19.08.2012, 16:58
(
Последний раз редактировалось ipsBruno; 19.08.2012 в 17:42.
)
Agora pouco falei com Pedro_BML sobre criar uma fogueira em SA:MP. Ele me mandou uma base e eu finalizei com animaзхes e tudo
Nгo ficou perfeito, fiz em poucos minutos.
Cуdigo
Vнdeo
[ame]http://www.youtube.com/watch?v=XYzDjOtkb5M[/ame]
- Criado por Bruno da Silva. Obrigado a Pedro_BML, por me passar o id do fogo
Nгo ficou perfeito, fiz em poucos minutos.
Cуdigo
pawn Код:
//
// Criado por Bruno da Silva
// Sempre coloque os crйditos !!
//
forward ApagarFogo(playerid);
public ApagarFogo(playerid) {
SendClientMessage(playerid, -1, "[Info] A fogueira foi apagada !! ");
/*
TextDrawHideForPlayer(playerid, introTextDraw2);
TextDrawHideForPlayer(playerid, introTextDraw3);
TextDrawHideForPlayer(playerid, introTextDraw5);
*/
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, true);
DestroyObject(GetPVarInt(playerid, "fogueira2"));
DestroyObject(GetPVarInt(playerid, "fogueira1"));
ClearAnimations(playerid);
ClearAnimations(playerid);
return true;
}
forward TerminarFogueira(playerid);
public TerminarFogueira(playerid) {
static
Float:px,
Float:py,
Float:pz;
GetObjectPos(GetPVarInt(playerid, "fogueira1"), px, py, pz);
ClearAnimations(playerid);
SetPVarInt(playerid, "Fogueira", SetTimerEx("ApagarFogo", 15000, false, "i", playerid));
SendClientMessage(playerid, -1, "[Info] Vocк acendeu a fogueira");
ApplyAnimation(playerid,"MISC","SEAT_LR",4.1,0,0,0,1,1);
SetPVarInt(playerid, "fogueira2", CreateObject(18688, px,py,pz-1.47,0.0,0.0,0.0));
return true;
}
cmd(fogueira, playerid, params[]) {
TogglePlayerControllable(playerid, false);
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,1,0);
static
Float:px,
Float:py,
Float:pz,
Float:pa;
GetPlayerPos(playerid, px, py, pz);
GetPlayerFacingAngle(playerid, pa);
px += floatsin ( -pa, degrees) * 2.5;
py += floatcos ( -pa, degrees) * 2.5;
SetPVarInt(playerid, "fogueira1", CreateObject(841, px,py,pz-0.5,0.0,0.0,0.0));
SetPlayerCameraPos(playerid, px +2, py+2, pz+3.5);
SetPlayerCameraLookAt(playerid, px, py, pz);
/*
TextDrawShowForPlayer(playerid, introTextDraw2);
TextDrawShowForPlayer(playerid, introTextDraw3);
TextDrawShowForPlayer(playerid, introTextDraw5);
*/
SetPVarInt(playerid, "Fogueira", SetTimerEx("TerminarFogueira", 5000, false, "i", playerid));
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,1,0);
return true;
}
[ame]http://www.youtube.com/watch?v=XYzDjOtkb5M[/ame]
- Criado por Bruno da Silva. Obrigado a Pedro_BML, por me passar o id do fogo