[Ajuda] /corrente
#5

pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#define TireDano(%1,%2,%3,%4) %1 | (%2 << 1) | (%3 << 2) | (%4 << 3)
new
Tapete,
Float:xx,
Float:yy,
Float:zz;
forward
PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward
Pneu(playerid);
public
    PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
    {
        if(IsPlayerConnected(playerid)) {
            new Float:oldposx, Float:oldposy, Float:oldposz;
            new Float:tempposx, Float:tempposy, Float:tempposz;
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
            tempposx = (oldposx -x);
            tempposy = (oldposy -y);
            tempposz = (oldposz -z);
//          printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
            if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) {
                return 1;
            }
        }
        return 0;
    }
 
 
public
    OnFilterScriptInit()
    {
        print("\n--------------------------------------");
        print(" Tapede Load By: [FeK]Higor");
        print("--------------------------------------\n");
        SetTimer("Pneu",199,1);
        return 1;
    }
 
 
public
    Pneu(playerid)
    {
        new Dano[4];
        if (IsPlayerInAnyVehicle(playerid)) {
            if (PlayerToPoint(5.0, playerid,xx,yy,zz)) {
                GetVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], Dano[3]);
                UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], TireDano(1, 1, 1, 1));
                GameTextForPlayer(playerid,"~w~Pneu Furado :)",6000,1);
            }
        }
    }
 
 
public
    OnPlayerCommandText(playerid, cmdtext[])
    {
 
        if (strcmp("/criartapete", cmdtext, true, 10) == 0) {
            GetPlayerPos(playerid,xx,yy,zz);
            Tapete = CreateObject(2899, xx, yy, zz, 0, 0,0);
            GameTextForPlayer(playerid,"~w~Tapede criado :)",6000,1);
            return 1;
        }
 
        if (strcmp("/deletartapete", cmdtext, true, 10) == 0) {
            DestroyObject(Tapete);
            GameTextForPlayer(playerid,"~w~Tapede Deletado",6000,1);
            return 1;
        }
 
        return 0;
    }
Tenta ae.
Reply


Messages In This Thread
[Ajuda] /corrente - by Dark_Max - 24.03.2012, 04:07
Re: [Ajuda] /corrente - by 4LiSs0N - 24.03.2012, 12:13
Re: [Ajuda] /corrente - by Guilherme_. - 24.03.2012, 12:19
Re: [Ajuda] /corrente - by Dark_Max - 24.03.2012, 15:55
Re: [Ajuda] /corrente - by Markos - 24.03.2012, 20:04
Re: [Ajuda] /corrente - by Dark_Max - 25.03.2012, 15:18

Forum Jump:


Users browsing this thread: 1 Guest(s)