SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/01/2013, 11:17 AM   #1
joska
Little Clucker
 
Join Date: Jun 2012
Posts: 5
Reputation: 0
Question Repair pickup problem

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 (c) 1997-2006, ITB CompuPhase


6 Errors.
joska is offline   Reply With Quote
Old 01/01/2013, 11:44 AM   #2
davve95
High-roller
 
davve95's Avatar
 
Join Date: Nov 2009
Location: Sweden
Posts: 3,138
Reputation: 234
Default Re: Repair pickup problem

I will check it but can you use [pawn] your code here [ /pawn] It will get much more easy to read.
davve95 is offline   Reply With Quote
Old 01/01/2013, 11:45 AM   #3
LetsOWN[PL]
Huge Clucker
 
LetsOWN[PL]'s Avatar
 
Join Date: May 2011
Location: Polska
Posts: 328
Reputation: 13
Default Re: Repair pickup problem

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 Code:
new Pickup[1];
instead of
pawn Code:
new Pickup[];

2nd thing.
pawn Code:
forward Pickupop;
instead of
pawn Code:
forward Pickup;

Why you're forwarding something for variable, not for public, eh?
You've done this script very chaotically.

Next thing:
pawn Code:
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
LetsOWN[PL] is offline   Reply With Quote
Old 01/01/2013, 11:58 AM   #4
joska
Little Clucker
 
Join Date: Jun 2012
Posts: 5
Reputation: 0
Default Re: Repair pickup problem

It freezes Pawn
joska is offline   Reply With Quote
Old 01/01/2013, 12:00 PM   #5
joska
Little Clucker
 
Join Date: Jun 2012
Posts: 5
Reputation: 0
Default Re: Repair pickup problem

The whole of this part do not get someone to do it for me?
joska is offline   Reply With Quote
Old 01/01/2013, 12:01 PM   #6
LetsOWN[PL]
Huge Clucker
 
LetsOWN[PL]'s Avatar
 
Join Date: May 2011
Location: Polska
Posts: 328
Reputation: 13
Default Re: Repair pickup problem

Quote:
Originally Posted by joska View Post
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
LetsOWN[PL] is offline   Reply With Quote
Old 01/01/2013, 12:04 PM   #7
joska
Little Clucker
 
Join Date: Jun 2012
Posts: 5
Reputation: 0
Default Re: Repair pickup problem

I try to re-compile but I do not think it succeeds
joska is offline   Reply With Quote
Old 01/01/2013, 12:23 PM   #8
joska
Little Clucker
 
Join Date: Jun 2012
Posts: 5
Reputation: 0
Default Re: Repair pickup problem

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?
joska is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with auto repair ! Unirom Shaw Scripting Help 3 24/12/2012 01:57 PM
Pickup auto repair cruising Help Archive 2 15/07/2011 10:51 AM
Car repair pickup Daslee Help Archive 7 26/12/2009 04:41 PM


All times are GMT. The time now is 04:37 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.