[FilterScript] PlantBomb v1.0 (BETA)
#2

Para los que son vagos aqui tienen el pawn:

pawn Код:
#include <a_samp>
#include <djson>
#include <zcmd>
#include <sscanf>
#pragma tabsize 0

#define MENSAJE 0xC69E80FF

enum Bomba {
    name[24],
    Float:X,
    Float:Y,
    Float:Z,
    str[24],
    BombaObjecto
    };
new BombaDatos[MAX_PLAYERS][Bomba];

public OnPlayerConnect(playerid)
{
    GetPlayerName(playerid, BombaDatos[playerid][name], 24);
    format(BombaDatos[playerid][str], 24, "%s.bomb", BombaDatos[playerid][name]);
    if(!fexist(BombaDatos[playerid][str]))
    {
        djCreateFile(BombaDatos[playerid][str]);
        }
       
    return 1;
    }
public OnFilterScriptInit()
{
    djson_GameModeInit();
   
    CreateObject(18092,2431.39990234,-1679.00000000,13.19999981,0.00000000,0.00000000,0.00000000); //object(ammun3_counter) (1)
    CreateObject(364,2432.10009766,-1678.80004883,13.69999981,0.00000000,0.00000000,0.00000000); //object(1)
    CreateObject(1654,2431.80004883,-1678.69995117,13.89999962,0.00000000,0.00000000,176.98980713); //object(dynamite) (1)
    CreateObject(2968,2430.39990234,-1678.80004883,14.00000000,0.00000000,0.00000000,0.00000000); //object(cm_box) (1)

    Create3DTextLabel("Use: /Comprar bomba [tipo]", 0xA40000FF,2431.4402,-1677.4337,13.7235,40.0,0);

    AddStaticPickup(1239, 0, 2431.4402,-1677.4337,13.7235);
   
    return 1;
}

public OnFilterScriptExit()
{
    djson_GameModeExit();
   
    return 1;
}
CMD:ayuda(playerid, params[])
{
    new b[6];
    if(sscanf(params, "s", b))SendClientMessage(playerid, MENSAJE, "USE: /Ayuda bomba");
    else if(strfind(b, "bomba", true ) != -1)SendClientMessage(playerid, MENSAJE, "BombGraph CMD: /Comprar bomba, /Plantar, /Detonar, /Puntov.");
    else
    {
        SendClientMessage(playerid, MENSAJE, "USE: /Ayuda bomba.");
    }
    return 1;
}
CMD:comprar(playerid, params[])
{
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, 2431.4402,-1677.4337,13.7235))
    {
        SendClientMessage(playerid, MENSAJE, "Debe estar en el punto de venta.");
        SendClientMessage(playerid, MENSAJE, "USE: /Puntov.");
        return 0;
    }
    new b[6];
    if (sscanf(params, "s", b)) SendClientMessage(playerid, MENSAJE, "USE: /Comprar bomba.");
    else if (strfind(b, "bomba", true ) != -1)
    {
        djSet(BombaDatos[playerid][str], "Tiene", "Si");
        GivePlayerMoney(playerid, -1000);
    }
    return 1;
}
CMD:plantar(playerid, params[])
{
    GetPlayerPos(playerid, BombaDatos[playerid][X], BombaDatos[playerid][Y], BombaDatos[playerid][X]);
    djSetFloat(BombaDatos[playerid][str], "BombaX", BombaDatos[playerid][X]);
    djSetFloat(BombaDatos[playerid][str], "BombaY", BombaDatos[playerid][Y]);
    djSetFloat(BombaDatos[playerid][str], "BombaZ", BombaDatos[playerid][Z]);
    BombaDatos[playerid][BombaObjecto] = CreateObject(1654,djFloat(BombaDatos[playerid][str], "BombaX"),djFloat(BombaDatos[playerid][str], "BombaY")+01,djFloat(BombaDatos[playerid][str], "BombaZ")-1+0.0,260.00000000,90.00000000,150.00000000);
    return 1;
}
CMD:detonar(playerid, params[])
{
    DestroyObject(BombaDatos[playerid][BombaObjecto]);
    CreateExplosion(djFloat(BombaDatos[playerid][str], "BombaX"),djFloat(BombaDatos[playerid][str], "BombaY")+01,djFloat(BombaDatos[playerid][str], "BombaZ"), 6, 10.0);
    djUnset(BombaDatos[playerid][str], "BombaX");
    djUnset(BombaDatos[playerid][str], "BombaY");
    djUnset(BombaDatos[playerid][str], "BombaZ");
    djUnset(BombaDatos[playerid][str], "Tiene");
    return 1;
}
/*     NO BORRE O SALDRБ Unknow: Command. */
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(!success)
   {
   }
   return 1;
}

Tengo una duda, yo uso zcmd, y no pongo eso al final y no me aparece unknowcommand,.

Sugerencia: Usar IsPlayerInRangeOfPoint o chequear si el player esta en un interior para comprarlo dentro de un ammu nation, muy bueno. (Y)
Reply


Messages In This Thread
PlantBomb v1.0 (BETA) - by LuisGraph - 07.02.2012, 04:52
Respuesta: PlantBomb v1.0 (BETA) - by [Nikk] - 07.02.2012, 05:05
Re: PlantBomb v1.0 (BETA) - by LuisGraph - 07.02.2012, 16:05
Respuesta: PlantBomb v1.0 (BETA) - by adrianxd - 07.02.2012, 17:25
Respuesta: PlantBomb v1.0 (BETA) - by LuisGraph - 07.02.2012, 18:10
Respuesta: PlantBomb v1.0 (BETA) - by adrianxd - 07.02.2012, 18:28

Forum Jump:


Users browsing this thread: 2 Guest(s)