SA-MP Forums Archive
Help error message - 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 error message (/showthread.php?tid=303057)



Help error message - davve95 - 11.12.2011

Hi!

I'm trying to make interiors to my server but I just get error messages so could u show me
how it should look like?... (I'm a begginer with scripting pawno)
So I can't fix all of the error messages but some.

Here is the code:

pawn Код:
//Creating the arrow
new pickupname;

public OnGameModeInit()
{
    pickupname = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
    //Arrow = 1318
    //Type
    //  23 Pickupable, but doesn't disappear on pickup.
    //  2   Pickupable, respawns after some time.
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(pickupid == pickupname)
    {
        //Your function
    }
}

Код:
Thanks alot for help! :)



Re: Help error message - doreto - 11.12.2011

you will show as your try and what error you get?


Re: Help error message - davve95 - 11.12.2011

Quote:
Originally Posted by doreto
Посмотреть сообщение
you will show as your try and what error you get?
Okay I thought another way first but yes we can do like this

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

new MoneyBag; //MoneyBagID
new pickupname;
main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}


    public OnGameModeInit()
    {
    SetGameModeText("Blank Script");
    {
          pickupname = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
        //Arrow = 1318
        //Type
        //  23 Pickupable, but doesn't disappear on pickup.
        //  2   Pickupable, respawns after some time.
        }

    public OnPlayerPickUpPickup(playerid,pickupid);
    {
        if(pickupid == pickupname)
        {
            //Your function
        }
    }

Error messages:

Код:
C:\Users\Davve\Desktop\Min server FTW\Capture MOney A51 use TESTA MED FЦRST.pwn(21) : error 017: undefined symbol "model"
C:\Users\Davve\Desktop\Min server FTW\Capture MOney A51 use TESTA MED FЦRST.pwn(26) : error 001: expected token: ";", but found "}"
C:\Users\Davve\Desktop\Min server FTW\Capture MOney A51 use TESTA MED FЦRST.pwn(28) : error 029: invalid expression, assumed zero
C:\Users\Davve\Desktop\Min server FTW\Capture MOney A51 use TESTA MED FЦRST.pwn(28) : error 017: undefined symbol "playerid"
C:\Users\Davve\Desktop\Min server FTW\Capture MOney A51 use TESTA MED FЦRST.pwn(30) : error 017: undefined symbol "pickupid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Код:
 And aslo thanks for fast answer :D



Respuesta: Re: Help error message - godoy32 - 11.12.2011

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

new MoneyBag; //MoneyBagID
new pickupname;
main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}


public OnGameModeInit()
{
    SetGameModeText("Blank Script");
    pickupname = CreatePickup(1318, 23,X, Y, Z, 0);
        //Arrow = 1318
        //Type
        //  23 Pickupable, but doesn't disappear on pickup.
        //  2   Pickupable, respawns after some time.
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(pickupid == pickupname)
    {
        //CJ's house
        SetPlayerInterior(playerid, 3); //put the interior id here
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerPos(playerid,2496.049804,-1695.238159,1014.742187);
        SendClientMessage(playerid, 0x33CCFFAA, "You have Teleported to cj'house");
    }
}
In X,Y,Z you put the coordinates


Re: Help error message - doreto - 11.12.2011

PHP код:
new pickupname;
public 
OnGameModeInit()
{
    
pickupname CreatePickup(1242112,34,56,0);
    
    
//1242- its armor
    // 1- Not pickupable, exists all the time
    //12,34,56 - is possition on pickup you can change
    //0- its virtual world
}
public 
OnPlayerPickUpPickup(playerid,pickupid)
{
    if(
pickupid == pickupname)
    {
        
SetPlayerPos(palyerid,123,123,123);//change possition were you wonna play to go when pass pickup
    
}
}
public 
OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == ShopShowPlayerDialog(playerid,DIALOG_PICKUP,DIALOG_STYLE_LIST,"Shop","Beer\t"GREEN"100$\nMountain Bike\t"GREEN"1000$\nPlane license\t"GREEN"5000$","Select","Exit");
    return 
true;

and next time you can use this this and this


Re: Help error message - davve95 - 11.12.2011

Thanks alot!


Edit: Still get error messages I don't know to 100% To fix etc...


Respuesta: Help error message - godoy32 - 11.12.2011

You have in
pawn Код:
pickupname = CreatePickup(1318, 23,X, Y, Z, 0);
X,Y,Z or coordinates Ex: -1261.54,215.61,3.84


Re: Help error message - Kostas' - 11.12.2011

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

new
    MoneyBag, // MoneyBagID
    /*
        You should use "MoneyBag" somewhere in your script,
        because the result will be a warning 203: symbol is never used: "MoneyBag".
    */

    pickupname;

main() {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Blank Script");
    /*
        Change the parameters --> CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
        CreatePickup(1318, 2, 1503.3359, 1432.3585, 10.1191, -1); --> Is just an example.
    */

    pickupname = CreatePickup(1318, 2, 1503.3359, 1432.3585, 10.1191, -1);
    /*
        Arrow = 1318
        Type
        23 Pickupable, but doesn't disappear on pickup.
        2 Pickupable, respawns after some time.
    */

    return 1;
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(pickupid == pickupname) {
        // Your function
    }
    return 1;
}



Re: Help error message - davve95 - 12.12.2011

Quote:
Originally Posted by godoy32
Посмотреть сообщение
You have in
pawn Код:
pickupname = CreatePickup(1318, 23,X, Y, Z, 0);
X,Y,Z or coordinates Ex: -1261.54,215.61,3.84
Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

new
    MoneyBag, // MoneyBagID
    /*
        You should use "MoneyBag" somewhere in your script,
        because the result will be a warning 203: symbol is never used: "MoneyBag".
    */

    pickupname;

main() {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    SetGameModeText("Blank Script");
    /*
        Change the parameters --> CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
        CreatePickup(1318, 2, 1503.3359, 1432.3585, 10.1191, -1); --> Is just an example.
    */

    pickupname = CreatePickup(1318, 2, 1503.3359, 1432.3585, 10.1191, -1);
    /*
        Arrow = 1318
        Type
        23 Pickupable, but doesn't disappear on pickup.
        2 Pickupable, respawns after some time.
    */

    return 1;
}

public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(pickupid == pickupname) {
        // Your function
    }
    return 1;
}
Thanks alot I will see if I can fix!