To make one command -
Roma555 - 11.01.2011
How to make one command discovery cowl closing?
Код:
if (strcmp("/bonneton", cmdtext, true, 10) == 0)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,lights,alarm,doors,true,boot,objective);
return 1;
}
Код:
if (strcmp("/bonnetoff", cmdtext, true, 10) == 0)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,lights,alarm,doors,false,boot,objective);
return 1;
}
Here so:
/boonect - to open/close
Re: To make one command -
Haydz - 11.01.2011
You will need to create a variable.
pawn Код:
new bonnetvar[MAX_PLAYERS]; //top of the script
if (strcmp("/bonnet", cmdtext, true, 10) == 0)
{
if(bonnetvar[playerid] == 0)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,lights,alarm,doors,false,boot,objective);
bonnetvar[playerid] = 1;
}
else
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,lights,alarm,doors,false,boot,objective);
bonnetvar[playerid] = 0;
}
return 1;
}
Something like that should hopefully work, if i did something wrong you could work it out with this thread
https://sampforum.blast.hk/showthread.php?tid=189464
Re: To make one command -
Roma555 - 11.01.2011
And so it is possible?
Код:
if (strcmp("/bonnet", cmdtext, true, 10) == 0)
{
if(GetPVarInt(playerid, "bonnet") == 0)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,lights,alarm,doors,true,boot,objective);
SetPVarInt(playerid, "bonnet", 1);
}
else if(GetPVarInt(playerid, "bonnet") == 1)
{
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carid,engine,lights,alarm,doors,false,boot,objective);
SetPVarInt(playerid, "bonnet", 0);
}
return 1;
}
Re: To make one command -
Haydz - 11.01.2011
Yeh you can use PVars to.
Re: To make one command -
Steven82 - 12.01.2011
Why would you use player varibles. It will not really bug but you may have to do the command twice for it to say open when you switch vehicles. I made mine use say
pawn Код:
new hood[MAX_VEHICLES];
hood[vehicleid] = 1;
Ofc this aint the whole code, but i hope you know what i meant.