What did i do wrong
#1

I dunno what i done wrong when i type in game /sultan nothing happens same with /elegy

Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define COLOR_PURPLE
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
}	print("\n--------------------------------------");
print(" Tune Youre Car Filterscript by 3lm0" );
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/elegy", true)==0)
{
AddVehicleComponent(562, 1010);
AddVehicleComponent(562, 1034);
AddVehicleComponent(562, 1036);
AddVehicleComponent(562, 1146);
AddVehicleComponent(562, 1149);
AddVehicleComponent(562, 1171);
ChangeVehiclePaintjob(562, 3);
ChangeVehicleColor(562, 6, 6);
return 1;
}
if (strcmp("/sultan", cmdtext, true, 10) == 0)
{
ChangeVehiclePaintjob(560, 3);
ChangeVehicleColor(560, 6, 6);
SetVehicleNumberPlate(560, "Future");
AddVehicleComponent(560, 1139);
AddVehicleComponent(560, 1169);
AddVehicleComponent(560, 1010);
AddVehicleComponent(560, 1141);
IsPlayerInVehicle(playerid, 560);
return 1;
}
return 0;
}
#endif
Reply
#2

where is addstaticvehicle?
or what ever it shll be
Reply
#3

?? i just need something when ur in a elegy or sultan and u do /sultan that it tunes to that code :P
Reply
#4

It's like u step in the elegy u type /elegy and it tunes to things that is made in that script.

Maybe someone can send me good one?
Reply
#5

The server needs to know on what car to apply the paintjob/components.
Do something like this in the begining of your cmd

pawn Код:
new mycar;
mycar = GetPlayerVehicleID(playerid);
ChangeVehiclePaintjob(mycar,3);
AddVehicleComponent(mycar, 1010);
//etc...
Reply
#6

Quote:
Originally Posted by dice7
The server needs to know on what car to apply the paintjob/components.
Do something like this in the begining of your cmd

pawn Код:
new mycar;
mycar = GetPlayerVehicleID(playerid);
ChangeVehiclePaintjob(mycar,3);
AddVehicleComponent(mycar, 1010);
//etc...
like this?
pawn Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define COLOR_PURPLE
#define mycar
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
new mycar; //i have changed this and //////////////////////////////////
mycar = GetPlayerVehicleID(playerid); // this/////////////////////////////
}   print("\n--------------------------------------");
    print(" Tune Youre Car Filterscript by 3lm0"  );
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/elegy", true)==0)
     {
    AddVehicleComponent(562, 1010);
    AddVehicleComponent(562, 1034);
    AddVehicleComponent(562, 1036);
      AddVehicleComponent(562, 1146);
      AddVehicleComponent(562, 1149);
      AddVehicleComponent(562, 1171);
      ChangeVehiclePaintjob(562, 3);
      ChangeVehicleColor(562, 6, 6);
    return 1;
    }
    if (strcmp("/sultan", cmdtext, true, 10) == 0)
    {
        ChangeVehiclePaintjob(560, 3);
        ChangeVehicleColor(560, 6, 6);
        SetVehicleNumberPlate(560, "Future");
        AddVehicleComponent(560, 1139);
        AddVehicleComponent(560, 1169);
        AddVehicleComponent(560, 1010);
        AddVehicleComponent(560, 1141);
        IsPlayerInVehicle(playerid, 560);
        return 1;
    }
    return 0;
}
#endif
Reply
#7

like so:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/elegy", true)==0)
     {
    new mycar;
    mycar = GetPlayerVehicleID(playerid);
    AddVehicleComponent(mycar, 1010);
    AddVehicleComponent(mycar, 1034);
    AddVehicleComponent(mycar, 1036);
    AddVehicleComponent(mycar, 1146);
    AddVehicleComponent(mycar, 1149);
    AddVehicleComponent(mycar, 1171);
    ChangeVehiclePaintjob(mycar, 3);
    ChangeVehicleColor(mycar, 6, 6);
    return 1;
    }
}
and you use the "#define" thingy to give a variable its value. Like for example
Код:
#define COLOR_PURPLE 0x800080AA
COLOR_PURPLE is the name which you can use anywhere and 0x800080AA is its hex color code. The script will know that COLOR_PURPLE is equal 0x800080AA
Reply
#8

Quote:
Originally Posted by dice7
like so:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/elegy", true)==0)
     {
   new mycar;
   mycar = GetPlayerVehicleID(playerid);
   AddVehicleComponent(mycar, 1010);
   AddVehicleComponent(mycar, 1034);
   AddVehicleComponent(mycar, 1036);
   AddVehicleComponent(mycar, 1146);
   AddVehicleComponent(mycar, 1149);
   AddVehicleComponent(mycar, 1171);
   ChangeVehiclePaintjob(mycar, 3);
   ChangeVehicleColor(mycar, 6, 6);
   return 1;
    }
}
errors

[pawn
]C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(31) : error 001: expected token: "-identifier-", but found ";"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(32) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(32) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(33) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(33) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(33) : warning 215: expression has no effect
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(33) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(33) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Luc\Bureaublad\Pawno\filterscripts\comman ds.pwn(33) : fatal error 107: too many error messages on one line

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


6 errors
[/pawn]
Reply
#9

show the whole code and mark the lines
Reply
#10

Quote:
Originally Posted by dice7
show the whole code and mark the lines
pawn Код:
#include <a_samp>

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#define COLOR_PURPLE
#define mycar
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
new mycar;
mycar = GetPlayerVehicleID(playerid);
}   print("\n--------------------------------------");
    print(" Tune Youre Car Filterscript by 3lm0"  );
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/elegy", true)==0)
     {
    new mycar;
    mycar = GetPlayerVehicleID(playerid);
    AddVehicleComponent(mycar, 1010);
    AddVehicleComponent(mycar, 1034);
    AddVehicleComponent(mycar, 1036);
    AddVehicleComponent(mycar, 1146);
    AddVehicleComponent(mycar, 1149);
    AddVehicleComponent(mycar, 1171);
    ChangeVehiclePaintjob(mycar, 3);
    ChangeVehicleColor(mycar, 6, 6);
    return 1;
    }
}
    if (strcmp("/sultan", cmdtext, true, 10) == 0)
    {
        ChangeVehiclePaintjob(560, 3);
        ChangeVehicleColor(560, 6, 6);
        SetVehicleNumberPlate(560, "Future");
        AddVehicleComponent(560, 1139);
        AddVehicleComponent(560, 1169);
        AddVehicleComponent(560, 1010);
        AddVehicleComponent(560, 1141);
        IsPlayerInVehicle(playerid, 560);
        return 1;
    }
    return 0;
}
#endif
line 31:
pawn Код:
new mycar;
line 32:
pawn Код:
mycar = GetPlayerVehicleID(playerid);
line 33:
pawn Код:
AddVehicleComponent(mycar, 1010);
here it is
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)