Jump to content
  • 0

Problema /fill


Andrei_Jr

Question

Nick: Andrey.

Problema: Imi da erori sendusage,veh,engine

Erori / warnings: 6 erori

Lini/script:

[pawn] if(strcmp(cmd, "/fill", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendUsage(playerid,"/fill [numar litri]");

return 1;

}

moneys = strval(tmp);

new vid;

  new FillUpp;

    vid = GetPlayerVehicleID(playerid);

    FillUpp = GasMax - Gas[vid];

            if(FillUpp < moneys || moneys <= 0)

    {

SendClientMessage(playerid,COLOR_LIGHTRED,"ServeR: Ne pare rau, nu poti introduce in rezervor litri de benzina doriti.");

        return 1;

}

        if(GetPlayerMoneyEx(playerid) < moneys * SBizzInfo[3][sbEntranceCost])

{

  SendClientMessage(playerid, COLOR_LIGHTBLUE, "{DBED15}Angajat peco:{15D4ED} Nu ai destui bani, pentru a achita benzina.");

    return 1;

        }

        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);

if(engine == 1)

{

    SendClientMessage(playerid, COLOR_LIGHTBLUE, "{DBED15}Angajat peco:{15D4ED} Nu alimentam masinile cu motorul in functiune.");

    return 1;

}

if(IsAtGasStation(playerid))

{

    GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Alimentare masina, te rugam asteapta...",2000,3);

SetTimerEx("FillUp", RefuelWait, false, "i", playerid);

Refueling[playerid] = 1;

CaridRefuel[playerid] = vid;

RefuelPrice[playerid] = moneys * SBizzInfo[3][sbEntranceCost];

RefuelLitri[playerid] = moneys;

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Nu esti intr-o benzinarie!");

}

}

    return 1;

}[/pawn]

[pawn]public Fillup(playerid)

{

  if(IsPlayerConnected(playerid))

  {

if(Refueling[playerid] == 1)

    {

            new string[512];

Gas[CaridRefuel[playerid]] += RefuelLitri[playerid];

    format(string,sizeof(string),"{DBED15}Angajat peco:{15D4ED} Ti-am pus %d litri de benzina in rezervor , te-a costat: $%d.",RefuelLitri[playerid],RefuelPrice[playerid]);

    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);

GivePlayerMoneyEx(playerid, - RefuelPrice[playerid]);

SBizzInfo[3][sbTill] += RefuelPrice[playerid];

ExtortionSBiz(3, RefuelPrice[playerid]);

Refueling[playerid] = 0;

CaridRefuel[playerid] = 999;

RefuelPrice[playerid] =  0;

RefuelLitri[playerid] = 0;

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

C:\Documents and Settings\dwwf\Desktop\our-life.pwn(15589) : error 025: function heading differs from prototype

C:\Documents and Settings\dwwf\Desktop\our-life.pwn(43497) : error 017: undefined symbol "engine"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

prima eroare

[pawn]public Fillup(playerid)//aici prima eroare

{

  if(IsPlayerConnected(playerid))

  {

if(Refueling[playerid] == 1)

    {

            new string[512];

Gas[CaridRefuel[playerid]] += RefuelLitri[playerid];

    format(string,sizeof(string),"{DBED15}Angajat peco:{15D4ED} Ti-am pus %d litri de benzina in rezervor , te-a costat: $%d.",RefuelLitri[playerid],RefuelPrice[playerid]);

    SendClientMessage(playerid,COLOR_LIGHTBLUE,string);

GivePlayerMoneyEx(playerid, - RefuelPrice[playerid]);

SBizzInfo[3][sbTill] += RefuelPrice[playerid];

ExtortionSBiz(3, RefuelPrice[playerid]);

Refueling[playerid] = 0;

CaridRefuel[playerid] = 999;

RefuelPrice[playerid] =  0;

RefuelLitri[playerid] = 0;

}

}

return 1;

}[/pawn]

a doua [pawn]    GetVehicleParamsEx(engine,lights,alarm,doors,bonnet,boot,objective);[/pawn]

Link to comment
Share on other sites

new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
(vehicleid, &engine, &lights, &alarm, &doors, &bonnet, &boot, &objective)
vehicleid	The ID of the vehicle to get the parameters from.
&engine	Get the engine status. If 1, the engine is running..
&lights	Get the vehicle's lights' state. If 1 the lights are on.
&alarm	Get the vehicle's alarm state. If 1 the alarm is (or was) sounding.
&doors	Get the lock status of the doors. If 1 the doors are locked.
&bonnet	Get the bonnet/hood status. If 1, it's open.
&boot	Get the boot/trunk status. 1 means it is open.
&objective	Get the objective status. 1 means the objective is on.

Link : http://wiki.sa-mp.com/wiki/GetVehicleParamsEx

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

la comanda , in loc sa folosesti if(FillUpp < moneys || moneys <= 0) incearca if(tmp < moneys || moneys <= 0)

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Poftim:

[pawn]

    if(strcmp(cmd, "/fill", true) == 0)

    {

        if( !IsPlayerConnected( playerid ) ) return 1;

        new vid = GetPlayerVehicleID( playerid ), Litri = 0;

        tmp = strtok( cmdtext, idx );

       

        if( !strlen( tmp ) )

            return SendClientMessage( playerid, -1, "{FF0000}Use{FFFFFF}: /fill [numar litri]" );

        Litri = strval( tmp );

        if( !IsAtGasStation( playerid ) )

return SendClientMessage(playerid, COLOR_GREY, "Nu esti intr-o benzinarie!");

if( Litri > GasMax || Litri == 0 )

          return  SendClientMessage(playerid,COLOR_LIGHTRED,"ServeR: Ne pare rau, nu poti introduce in rezervor litri de benzina doriti." );

        if( GetPlayerMoneyEx( playerid ) < Litri * SBizzInfo[ 3 ][ sbEntranceCost ] )

return SendClientMessage( playerid, COLOR_LIGHTBLUE, "{DBED15}Angajat peco:{15D4ED} Nu ai destui bani, pentru a achita benzina." );

 

        GetVehicleParamsEx( vid, engine, lights, alarm, doors, bonnet, boot, objective );

if(engine == true)

            return SendClientMessage( playerid, COLOR_LIGHTBLUE, "{DBED15}Angajat peco:{15D4ED} Nu alimentam masinile cu motorul in functiune." );

        GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Alimentare masina, te rugam asteapta...",2000,3);

        SetTimerEx("FillUp", RefuelWait, false, "i", playerid);

        Refueling[playerid] = 1;

        CaridRefuel[playerid] = vid;

        RefuelPrice[playerid] = Litri * SBizzInfo[3][sbEntranceCost];

        RefuelLitri[playerid] = Litri;

    return 1;

    }[/pawn]

I'm back bitches.

Link to comment
Share on other sites

Pai imi da eroare.. cu [pawn]C:\Documents and Settings\dwwf\Desktop\our-life.pwn(43601) : error 017: undefined symbol "engine"

C:\Documents and Settings\dwwf\Desktop\our-life.pwn(43603) : error 017: undefined symbol "engine"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.[/pawn] si dak pun EngineStatus da eroare cu variabila..

Da-mi add pe mess (EDITED By Ph0eniX , Motiv: Fara ID-ul de messanger / skype sau altele in topic!")

Link to comment
Share on other sites

Topic inchis , 48h+ fara reply.

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.