SA-MP Forums Archive
Repair pickup problem - 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: Repair pickup problem (/showthread.php?tid=403943)



Repair pickup problem - joska - 01.01.2013

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.


Re: Repair pickup problem - davve95 - 01.01.2013

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


Re: Repair pickup problem - LetsOWN[PL] - 01.01.2013

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



Re: Repair pickup problem - joska - 01.01.2013

It freezes Pawn


Re: Repair pickup problem - joska - 01.01.2013

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


Re: Repair pickup problem - LetsOWN[PL] - 01.01.2013

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



Re: Repair pickup problem - joska - 01.01.2013

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


Re: Repair pickup problem - joska - 01.01.2013

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?