SA-MP Forums Archive
Help House of Death - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help House of Death (/showthread.php?tid=519102)



Help House of Death - UzumakiNaruto - 12.06.2014

Hello, I wanted some help here at my command, I am having problems after building the house he lives of those who are taking it, I tried putting the "IsPlayerInRangeOfPoint" in "OnPlayerUpdate" and was taking life after logging into the server, can help me with this?

pawn Код:
CMD:house(playerid, params[])
{
if(PlayerDados[playerid][Admin] < 1) return SendClientMessage(playerid, VERMELHO, "[ERROR] - You do not have Admin");
SetTimerEx("HouseD",0,false,"i",playerid);
return 1;
}

forward HouseD(playerid);
public HouseD(playerid)
{
    new Float:X, Float:Y, Float:Z, Float:A;
    new barril;
    GetPlayerPos(playerid, X, Y, Z);
    GetPlayerFacingAngle(playerid, A);
    PosicaoFrentePlayer(playerid, X, Y, 10);
    barril = housewood= CreateObject(18259, X, Y, Z-30, 0.0, -0.0, A-0, 300.0);
    Barris[tBarris] = barril;
    tBarris ++;
    PosicaoFrentePlayer(playerid, X, Y, 30);
    MoveObject(housewood,X,Y-1,Z, 5.00);
    ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
    format(String, sizeof(String), "{8B4513}%s: Creation of the House of Wood!", Nome(playerid));
    ProxDetector(10.0, playerid, String, WHITE,WHITE,WHITE,WHITE,WHITE);
    if(IsPlayerInRangeOfPoint(housewood, 1.5, x,y,z))
    {
        SetTimerEx("HouseDeath",10000,true,"i",playerid);
    }
    return true;
}
(OBS:The SetTimer "housed" will take every player's life 10000 seconds)


Re: Help House of Death - kamiliuxliuxliux - 12.06.2014

Why do you use a timer with no time to call a function? Simply instead of that use HouseD(playerid);.