SA-MP Forums Archive
[DUV] Pick up[RESOLVIDO] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [DUV] Pick up[RESOLVIDO] (/showthread.php?tid=147374)



[DUV] Pick up[RESOLVIDO] - Gangster_ - 11.05.2010

Compilando pickup.pwn...
C:\Users\glauco\Desktop\pickup.pwn(91) : error 010: invalid function or declaration

C:\Users\glauco\Desktop\pickup.pwn(103) : error 010: invalid function or declaration
C:\Users\glauco\Desktop\pickup.pwn(115) : error 010: invalid function or declaration
C:\Users\glauco\Desktop\pickup.pwn(12 : error 010: invalid function or declaration
C:\Users\glauco\Desktop\pickup.pwn(45) : warning 204: symbol is assigned a value that is never used: "pickup_A1"
C:\Users\glauco\Desktop\pickup.pwn(46) : warning 204: symbol is assigned a value that is never used: "pickup_A2"
C:\Users\glauco\Desktop\pickup.pwn(47) : warning 204: symbol is assigned a value that is never used: "pickup_A3"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


pawn Код:
pickup_A1 = CreatePickup(1275, 1, 253.3719,78.0132,1003.6406);//Pickup Skin
pickup_A2 = CreatePickup(1275, 1, 254.7950,78.3707,1003.6406);//Pickup Skin
pickup_A3 = CreatePickup(1275, 1, 255.2836,76.5384,1003.6406);//Pickup Skin

if (pickupid == pickup_A2)
SendClientMessage(playerid, Verde, "Skin de Cop 3");
SetPlayerSkin(playerid,282);
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerWeapon(playerid, 17, 9999);
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerWeapon(playerid, 39, 9999);
}

if (pickupid == pickup_A3)
SendClientMessage(playerid, Verde, "Skin de Cop 4");
SetPlayerSkin(playerid,284);
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerWeapon(playerid, 17, 9999);
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerWeapon(playerid, 39, 9999);
}


if (pickupid == pickup_A1)
SendClientMessage(playerid, Verde, "Skin de Cop 2");
SetPlayerSkin(playerid,281);
GivePlayerWeapon(playerid, 27, 9999);
GivePlayerWeapon(playerid, 29, 9999);
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerWeapon(playerid, 31, 9999);
GivePlayerWeapon(playerid, 17, 9999);
GivePlayerWeapon(playerid, 34, 9999);
GivePlayerWeapon(playerid, 39, 9999);
}



Re: [DUV] Pick up - russo666 - 11.05.2010

No topo tens que fazer:

pawn Код:
new pickup_A1;
new pickup_A2;
new pickup_A3;
Depois se estбs a fazer no gamemode tens que fazer isto que se segue no OnGameModeInit, caso seja num filterscript usas o OnFilterScriptInit:

pawn Код:
pickup_A1 = CreatePickup(1275, 1, 253.3719,78.0132,1003.6406);//Pickup Skin
pickup_A2 = CreatePickup(1275, 1, 254.7950,78.3707,1003.6406);//Pickup Skin
pickup_A3 = CreatePickup(1275, 1, 255.2836,76.5384,1003.6406);//Pickup Skin
E no OnPlayerPickUpPickup:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if (pickupid == pickup_A1)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 2");
        SetPlayerSkin(playerid,281);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if (pickupid == pickup_A2)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 3");
        SetPlayerSkin(playerid,282);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if (pickupid == pickup_A3)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 4");
        SetPlayerSkin(playerid,284);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }
    return 1;
}
Tinhas te esquecido a abrir a cheveta '{' de cada cena. O return 1 aн й opcional, a callback nгo tem nenhum em especнfico, por isso salvo erro em cada 'if bla bla bla' nгo й preciso nenhum return.




Re: [DUV] Pick up - FrozzenxXx - 11.05.2010

O de cima ficou melhor, desculpe pelo Post...

Quando estava digitando ele postou...


Re: [DUV] Pick up - Gangster_ - 11.05.2010

Quote:
Originally Posted by russooooo
No topo tens que fazer:

pawn Код:
new pickup_A1;
new pickup_A2;
new pickup_A3;
Depois se estбs a fazer no gamemode tens que fazer isto que se segue no OnGameModeInit, caso seja num filterscript usas o OnFilterScriptInit:

pawn Код:
pickup_A1 = CreatePickup(1275, 1, 253.3719,78.0132,1003.6406);//Pickup Skin
pickup_A2 = CreatePickup(1275, 1, 254.7950,78.3707,1003.6406);//Pickup Skin
pickup_A3 = CreatePickup(1275, 1, 255.2836,76.5384,1003.6406);//Pickup Skin
E no OnPlayerPickUpPickup:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if (pickupid == pickup_A1)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 2");
        SetPlayerSkin(playerid,281);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if (pickupid == pickup_A2)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 3");
        SetPlayerSkin(playerid,282);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if (pickupid == pickup_A3)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 4");
        SetPlayerSkin(playerid,284);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }
    return 1;
}
Tinhas te esquecido a abrir a cheveta '{' de cada cena. O return 1 aн й opcional, a callback nгo tem nenhum em especнfico, por isso salvo erro em cada 'if bla bla bla' nгo й preciso nenhum return.

Adianto nada

olha vo posta o Script inteiro

http://pastebin.com/xixfJ6st


Re: [DUV] Pick up - russo666 - 11.05.2010

Tu leste o meu post todo sequer?

Nesse teu filterscript que mandaste agora, tinha um 'if blablabla' sem chaveta aberta. Eu eliminei aн umas coisitas e melhorei a identaзгo, etc. Compilei sem erros. Nгo testei ingame.

pawn Код:
#include <a_samp>

#define Verde 0x33AA33AA

new pickup_A;
new pickup_B;
new pickup_C;
new pickup_D;
new pickup_A1;
new pickup_A2;
new pickup_A3;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("                    ");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

public OnGameModeInit()
{
    pickup_A = CreatePickup(1239, 1, 1568.5808,-1689.9780,6.2188);// Hospital:
    pickup_B = CreatePickup(1239, 1, 1564.9734,-1667.1722,28.3956);// Governo:
    pickup_C = CreatePickup(1239, 1, 1562.9734,-1667.1722,28.3956);//Pickup ARMAS
    pickup_D = CreatePickup(1275, 1, 253.7077,76.3095,1003.6406);//Pickup Skin
    pickup_A1 = CreatePickup(1275, 1, 253.3719,78.0132,1003.6406);//Pickup Skin
    pickup_A2 = CreatePickup(1275, 1, 254.7950,78.3707,1003.6406);//Pickup Skin
    pickup_A3 = CreatePickup(1275, 1, 255.2836,76.5384,1003.6406);//Pickup Skin
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup_A)
    {
        SendClientMessage(playerid, Verde, "Subiu no Teto da DP");
        SetPlayerPos(playerid,1569.6025,-1667.4752,28.3956);
    }

    if(pickupid == pickup_B)
    {
        SendClientMessage(playerid, Verde, "Desceu do Teto da DP");
        SetPlayerPos(playerid,1565.5808,-1689.9780,6.2188);
    }

    if(pickupid == pickup_C)
    {
        SendClientMessage(playerid, Verde, "Pegou as Armas :D");
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_D)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop");
        SetPlayerSkin(playerid,280);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_A1)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 2");
        SetPlayerSkin(playerid,281);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_A2)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 3");
        SetPlayerSkin(playerid,282);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_A3)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 4");
        SetPlayerSkin(playerid,284);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }
    return 1;
}



Re: [DUV] Pick up - Gangster_ - 11.05.2010

Deu Certo , MAAAAAAAAAAAAAAAAAAAS no server as pickups nгo funfaram

nenhuma das pickups funfo


Re: [DUV] Pick up - russo666 - 11.05.2010

pawn Код:
#include <a_samp>

#define Verde 0x33AA33AA

new pickup_A;
new pickup_B;
new pickup_C;
new pickup_D;
new pickup_A1;
new pickup_A2;
new pickup_A3;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("                    ");
    print("--------------------------------------\n");
    pickup_A = CreatePickup(1239, 1, 1568.5808,-1689.9780,6.2188);// Hospital:
    pickup_B = CreatePickup(1239, 1, 1564.9734,-1667.1722,28.3956);// Governo:
    pickup_C = CreatePickup(1239, 1, 1562.9734,-1667.1722,28.3956);//Pickup ARMAS
    pickup_D = CreatePickup(1275, 1, 253.7077,76.3095,1003.6406);//Pickup Skin
    pickup_A1 = CreatePickup(1275, 1, 253.3719,78.0132,1003.6406);//Pickup Skin
    pickup_A2 = CreatePickup(1275, 1, 254.7950,78.3707,1003.6406);//Pickup Skin
    pickup_A3 = CreatePickup(1275, 1, 255.2836,76.5384,1003.6406);//Pickup Skin
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup_A)
    {
        SendClientMessage(playerid, Verde, "Subiu no Teto da DP");
        SetPlayerPos(playerid,1569.6025,-1667.4752,28.3956);
    }

    if(pickupid == pickup_B)
    {
        SendClientMessage(playerid, Verde, "Desceu do Teto da DP");
        SetPlayerPos(playerid,1565.5808,-1689.9780,6.2188);
    }

    if(pickupid == pickup_C)
    {
        SendClientMessage(playerid, Verde, "Pegou as Armas :D");
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_D)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop");
        SetPlayerSkin(playerid,280);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_A1)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 2");
        SetPlayerSkin(playerid,281);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_A2)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 3");
        SetPlayerSkin(playerid,282);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }

    if(pickupid == pickup_A3)
    {
        SendClientMessage(playerid, Verde, "Skin de Cop 4");
        SetPlayerSkin(playerid,284);
        GivePlayerWeapon(playerid, 27, 9999);
        GivePlayerWeapon(playerid, 29, 9999);
        GivePlayerWeapon(playerid, 24, 9999);
        GivePlayerWeapon(playerid, 31, 9999);
        GivePlayerWeapon(playerid, 17, 9999);
        GivePlayerWeapon(playerid, 34, 9999);
        GivePlayerWeapon(playerid, 39, 9999);
    }
    return 1;
}
Testado in game. A funcionar.

Eu tinha feito isso como FS sу que tinha deixado a callback OnGameModeInit, por isso nгo dava. -.-'

P.S- Se tiveres o mesmo problema que eu que os FS nгo carregam direito, coloca isso num gamemode e verбs que estб a funcionar.


Re: [DUV] Pick up - Gangster_ - 12.05.2010

nem funfo

as pick up's sumiram


Re: [DUV] Pick up - russo666 - 12.05.2010

Epб lк o meu post todo!

Edit: Como eu disse estб tudo a funcionar direito, e eu jб percebi porque й que os FS nгo carregavam direito e a ti nгo carregou direito. No topo de tudo adiciona

pawn Код:
#define FILTERSCRIPT
Enjoy e lк os posts sempre por inteiro!