Repair pickup problem
#1

HELP!!!I started to do a repair pickup if I'm using it to give you a dialog which includes the command to auto repair errorzik but for me this is what could be the problem

#include <fixchars>
#include <a_samp>
#include <zcmd>
#define szin1 0x3030ffAA0
#define DialogBuyRepaired
#define FILTERSCRIPT
new Pickup[];
new BuyRepaired;

forward Pickup;


public Dialog_BuyRepaired(playerid, response, listitem);
{
if(pickupid == pickups[0][mrepair])
{
if(GetPlayerMoneyA(playerid) < 500)
{
SendClientMessage(playerid,0xD9E916FF,"* Jбrműved megjavнtva (500$)) !");
return 1;
}

new vehicleid = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicleid,1000.0);
return 1;
}
Pickupok() {
Pickup[0] = CreatePickup(1239, 23, -516.4319, -504.3886, 25.5234, -1);
Create3DTextLabel("Műhely",szin1, -516.4319, -504.3886, 26.5234,40.0,0);
}
public OnGameModeInit()
{
Pickupok();
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Pickup[0]){
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"M űhely","Szeretnйm megjavнtani a jбrművem","Rendben","Bezбr");
}
return 1;
}

Error:

D:\Mostani szerver\gamemodes\repair.pwn(7) : error 009: invalid array size (negative, zero or out of bounds)
D:\Mostani szerver\gamemodes\repair.pwn(10) : error 001: expected token: "(", but found ";"
D:\Mostani szerver\gamemodes\repair.pwn(13) : warning 235: public function lacks forward declaration (symbol "Dialog_BuyRepaired")
D:\Mostani szerver\gamemodes\repair.pwn(15) : error 017: undefined symbol "pickupid"
D:\Mostani szerver\gamemodes\repair.pwn(15) : warning 215: expression has no effect
D:\Mostani szerver\gamemodes\repair.pwn(15) : error 001: expected token: ";", but found "]"
D:\Mostani szerver\gamemodes\repair.pwn(15) : error 029: invalid expression, assumed zero
D:\Mostani szerver\gamemodes\repair.pwn(15) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#2

I will check it but can you use [pawn] your code here [ /pawn] It will get much more easy to read.
Reply
#3

Hello.
Next time please place your code into [.pawn][./pawn] tags (without dots '.').

First at all, you must declare 'Pickup' array size. For your code, you should paste this:
pawn Код:
new Pickup[1];
instead of
pawn Код:
new Pickup[];
2nd thing.
pawn Код:
forward Pickupop;
instead of
pawn Код:
forward Pickup;
Why you're forwarding something for variable, not for public, eh?
You've done this script very chaotically.

Next thing:
pawn Код:
public Dialog_BuyRepaired(playerid, response, listitem);
{
    if(pickupid == pickups[0][mrepair])
    {
   
    if(GetPlayerMoneyA(playerid) < 500)
    {
    SendClientMessage(playerid,0xD9E916FF,"* Jбrműved megjavнtva (500$)) !");
    return 1;
    }

    new vehicleid = GetPlayerVehicleID(playerid);
    SetVehicleHealth(vehicleid,1000.0);
    return 1;
}
}
Forget closing } at the very end??

That should be all.

Greetz,
LetsOWN
Reply
#4

It freezes Pawn
Reply
#5

The whole of this part do not get someone to do it for me?
Reply
#6

Quote:
Originally Posted by joska
Посмотреть сообщение
It freezes Pawn
So perhaps you've even more messy code.
If I were you, I'd rewrite entire script (well, at least part with pickup) in another file, and try to compile.
If it would worked, you could paste this 'fresh' code into your gamemode (?) and then try to compile again. If pawn would freze again, then you did some mistakes somewhere in the code.
That should be it..

Greetz,
LetsOWN
Reply
#7

I try to re-compile but I do not think it succeeds
Reply
#8

This does not work for me. Otherwise, I would like to be able to improve a pickup truck.

Someone I would not write one of these?
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)