[Solved] Need a Paintjob command (Thanks guys)
#1

Hello Guys.

1°- Sorry my very bad English. Iґm from Argentina

2°- HELP ,..

Need a example of a /paint command.

When a player do "/paint" add a paintjob in his/er tune vehicle. .. BUT when this player do again "/paint", change the paintjob to

a paintjob(2) and If this player do again "/paint" change to paintjob(3)... etc. etc.

Thank!



Reply
#2

God have you ever tried Wiki...

Click here

but if your to lazy you can just look right here:
Код:
//In command form
	if(strcmp(cmd, "/paint", true) == 0)
  {
    if(IsPlayerConnected(playerid))
	  {
 ChangeVehicleColor(vehicleid, MAINCOLORID, SUBCOLORID);
return 1;
}

//or maybe its this way if you get errors
	if(strcmp(cmd, "/paint", true) == 0)
  {
    if(IsPlayerConnected(playerid))
	  {
 ChangeVehicleColor(vehicleid, MAINCOLORID, SUBCOLORID);
}
return 1;
}
If you want to make a paint job do this (like decals)
Код:
//Define this by the others
new Veh1;
//Under OnGameModeInit
veh = GetPlayerVehicleID(playerid);
//Command Form
	if(strcmp(cmd, "/paintjob", true) == 0)
  {
    if(IsPlayerConnected(playerid))
	  {
ChangeVehiclePaintjob(Veh1,1 - 5);
return 1;
}
Reply
#3

There is a sa-mp function. Use it.
Reply
#4

Quote:
Originally Posted by zanakinz
God have you ever tried Wiki...

Click here

but if your to lazy you can just look right here:
Код:
//In command form
	if(strcmp(cmd, "/paint", true) == 0)
  {
    if(IsPlayerConnected(playerid))
	  {
 ChangeVehicleColor(vehicleid, MAINCOLORID, SUBCOLORID);
return 1;
}

//or maybe its this way if you get errors
	if(strcmp(cmd, "/paint", true) == 0)
  {
    if(IsPlayerConnected(playerid))
	  {
 ChangeVehicleColor(vehicleid, MAINCOLORID, SUBCOLORID);
}
return 1;
}
If you want to make a paint job do this (like decals)
Код:
//Define this by the others
new Veh1;
//Under OnGameModeInit
veh = GetPlayerVehicleID(playerid);
//Command Form
	if(strcmp(cmd, "/paintjob", true) == 0)
  {
    if(IsPlayerConnected(playerid))
	  {
ChangeVehiclePaintjob(Veh1,1 - 5);
return 1;
}
thanks i go to see
Reply
#5

[quote=SakuraBloss ]

Hi again.

Not work.
When i do /paint i see the car with a strange paintjob.

This is my code:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

if(strcmp(cmdtext, "/paint", true)==0)
   {new vehicleid = GetPlayerVehicleID(playerid);
new cartype = GetVehicleModel(vehicleid);

if(cartype == 560){      // Sultan
ChangeVehiclePaintjob(vehicleid, 1 - 3 ); 

SendClientMessage(playerid,COLOR_BLUE,"[INFO] Sultan tuneado!");
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);}

return 1;}

	return 0;
}
Is an example for my.


Reply
#6

Can i use a "random paintjob" with the same command ? (i dont know how)

I want to do /paint --> paintjob[1], /paint again --> paintjob[2], /paint again --> paintjob[3] --> etc.

This is other impossible think.
Reply
#7

Its possible.
You should add something that saves the amount of times the paintjob has changed for that player

[color=red]This example will not work! Its just to show you what I'm talking about/color]
pawn Код:
//Player Typed /paint
//I would use random paintjobs if I was you.
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
ChangeVehiclePaintJob(vehicle, random(maxpaintjobnumber);
//This will give a random paintjob. This will be alsmost always different.
or

pawn Код:
//Player typed /paint
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
ChangeVehiclePaintJob(vehicle, PaintJob[playerid]);
Paintjob[playerid] ++;
Reply
#8


You say this ??

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/paint", true)==0)
   {new vehicleid = GetPlayerVehicleID(playerid);
new cartype = GetVehicleModel(vehicleid);

if(cartype == 562){      // Elegy
ChangeVehiclePaintjob(vehicleid, Paintjob[playerid]);
Paintjob[playerid] ++;


SendClientMessage(playerid,COLOR_BLUE,"[INFO] Elegy tuneado!");
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);}

return 1;}

	return 0;
}
C:\Users\Sakura\GTA cosas varias\sa-mp-0.2X.win32\filterscripts\TunePainjob.pwn(105) : error 017: undefined symbol "Paintjob"
C:\Users\Sakura\GTA cosas varias\sa-mp-0.2X.win32\filterscripts\TunePainjob.pwn(105) : warning 215: expression has no effect
C:\Users\Sakura\GTA cosas varias\sa-mp-0.2X.win32\filterscripts\TunePainjob.pwn(105) : error 001: expected token: ";", but found "]"
C:\Users\Sakura\GTA cosas varias\sa-mp-0.2X.win32\filterscripts\TunePainjob.pwn(105) : error 029: invalid expression, assumed zero
C:\Users\Sakura\GTA cosas varias\sa-mp-0.2X.win32\filterscripts\TunePainjob.pwn(105) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664

4 Errors.


My example.


Reply
#9

pawn Код:
//On top of the script
new PaintJob[MAX_PLAYERS];
//Back down
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/paint", true)==0)
   {
new vehicleid = GetPlayerVehicleID(playerid);
new cartype = GetVehicleModel(vehicleid);

if(cartype == 562){     // Elegy
ChangeVehiclePaintjob(vehicleid, Paintjob[playerid]);
Paintjob[playerid] ++;


SendClientMessage(playerid,COLOR_BLUE,"[INFO] Elegy tuneado!");
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);}

return 1;}

    return 0;
}
Reply
#10

lol the problem "Paintjob" - "PainJob" the J

Its working now, but.. the command show me +6 or 8 paintjob (with example car)

Elegy have 4 or 3 paintjob right ??
Reply


Forum Jump:


Users browsing this thread: 10 Guest(s)