need help
#1

ok so i want to start the engine of all cars with the number 3 on top of the keyboard not the numpad.
this is my code for /engine
please help

if(strcmp(cmdtext, "/engine", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(eVehInfo[GetPlayerVehicleID(playerid)][EMP] == 1) return SendClientMessage(playerid, c_r, "{5c99ff}[Info:] {dfebff} This vehicle has been EMP'd, it cannot be used.");
new EChk,LightsChk,AlarmChk,doorsChk,bonnetChk,bootChk ,objChk;
//VEHICLE_PARAMS_ON / VEHICLE_PARAMS_OFF
GetVehicleParamsEx(GetPlayerVehicleID(playerid),EC hk,LightsChk,AlarmChk,doorsChk,bonnetChk,bootChk,o bjChk);
if(EChk == 0 || EChk == -1)
{
if(PlayerInfo[playerid][Kidnap] == 1) return SendClientMessage(playerid, c_r, "{5c99ff}[Info:] {dfebff} You've been kidnapped and cannot leave in this manner! ");
if(PlayerInfo[playerid][Tazed] == 1) return SendClientMessage(playerid, c_r, "{5c99ff}[Info:] {dfebff} You cannot use this action at the moment.");
if(PlayerInfo[playerid][Tackle] == 1) return SendClientMessage(playerid, c_r, "{5c99ff}[Info:] {dfebff} You cannot use this action at the moment.");
if(PlayerInfo[playerid][Frozen] == 1) return SendClientMessage(playerid, c_r, "{5c99ff}[Info:] {dfebff} You cannot use this action at the moment.");
if(PlayerInfo[playerid][Tied] == 1) return SendClientMessage(playerid, c_r, "{5c99ff}[Info:] {dfebff} You cannot use this action at the moment.");
if(PlayerInfo[playerid][Leadby] != -255) return SendClientMessage(playerid, c_r, "{5c99ff}[Info:] {dfebff} You cannot use this action at the moment.");


if(PlayerInfo[playerid][Asleep] == 1) {
SendClientMessage(playerid, COLOR_MAIN, "You are currently sleeping and cannot perform this action at the moment!");
return 1;
}
if(PlayerInfo[playerid][Tazed] == 1) {
SendClientMessage(playerid, COLOR_MAIN, "You are currently tazed and cannot perform this action at the moment!");
return 1;
}
if(PlayerInfo[playerid][Tackle] == 1) {
SendClientMessage(playerid, COLOR_MAIN, "You are currently tackled and cannot perform this action at the moment!");
return 1;
}
if(PlayerInfo[playerid][Frozen] == 1) {
SendClientMessage(playerid, COLOR_MAIN, "You are currently cuffed and cannot perform this action at the moment!");
return 1;
}
if(PlayerInfo[playerid][Tied] == 1) {
SendClientMessage(playerid, COLOR_MAIN, "You are currently tied and cannot perform this action at the moment!");
return 1;
}

new PlayerVehicle = GetPlayerVehicleID(playerid);
new PlayVehModel = GetVehicleModel(PlayerVehicle);
PlayerInfo[playerid][EngineOff] = 0;

//TogglePlayerControllable(playerid, 1);

new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(PlayerVehicle,engine,lights,ala rm,doors,bonnet,boot,objective);
SetVehicleParamsEx(PlayerVehicle,VEHICLE_PARAMS_ON ,lights,alarm,doors,bonnet,boot,objective);

if(VehBomb[PlayerVehicle] == 1)
{
if((strcmp(ReturnPlayerName(playerid),"Chris_Icema n",true) == 0))
{
//nothin to see here.. move along
}
else
{
for(new m=0; m<MAX_PLAYERS; m++)
{
if(PlayerInfo[m][BombCar] == PlayerVehicle && PlayerInfo[m][BombPlanted] == 1 && PlayerInfo[m][Bomber] == 2)
{
new Float:X,Float:Y,Float:Z;
GetVehiclePos(PlayerVehicle,X,Y,Z);
for(new l=0; l<MAX_PLAYERS; l++)
{
if(GetPlayerVehicleID(l) == PlayerVehicle)
{
SetPlayerHealth(l, 0);
}
}
SetVehicleHealth(PlayerVehicle, 0);
CreateExplosion(X, Y , Z, 7,200.0);
CreateExplosion(X, Y , Z, 7,200.0);
CreateExplosion(X, Y , Z, 7,200.0);
CreateExplosion(X, Y , Z, 7,200.0);
CreateExplosion(X, Y , Z, 7,200.0);
CreateExplosion(X, Y , Z, 7,200.0);
CreateExplosion(X, Y , Z, 7,200.0);
CreateExplosion(X, Y , Z, 7,200.0);
PlayerInfo[m][BombPlanted] = 0;
PlayerInfo[m][Bomber] = 0;
VehBomb[PlayerVehicle] = 0;
for(new l=0; l<MAX_PLAYERS; l++){
if(IsPlayerConnected(l)){
if(GetDistanceBetweenPlayers(playerid,l) <= 100 && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(l))){
new kelstr[256];
new sexverb[256];
if(PlayerInfo[playerid][pSex] == 1) { sexverb = "his"; }
else if(PlayerInfo[playerid][pSex] == 2) { sexverb = "her"; }
else { sexverb = "their"; }
format(kelstr, 256, "* %s puts %s key in the ignition and turns it, setting off the bomb wired to %s car *", ReturnPlayerName(playerid),sexverb,sexverb);
SendClientMessage(l,COLOR_CYAN,kelstr);
}
}
}
return 1;
}
}
return 1;
}
}

new stringme[256];
new sexverb[256];
if(PlayerInfo[playerid][pSex] == 1) { sexverb = "his"; }
else if(PlayerInfo[playerid][pSex] == 2) { sexverb = "her"; }
else { sexverb = "their"; }
if(PlayerVehicle == trans_Gea || PlayerVehicle == trans_scar || PlayerVehicle == trans_trip || PlayerVehicle == trans_86 || PlayerVehicle == trans_scourge || PlayerVehicle == trans_trinity || PlayerVehicle == trans_age || PlayerVehicle == trans_araquiel || PlayerVehicle == trans_ghentriel
|| PlayerVehicle == trans_stratos || PlayerVehicle == trans_gir || PlayerVehicle == trans_shadow || PlayerVehicle == trans_ghost || PlayerVehicle == trans_fury || PlayerVehicle == trans_simba || PlayerVehicle == trans_aelita || PlayerVehicle == trans_hunter || PlayerVehicle == trans_socks || PlayerVehicle == trans_leonidas || PlayerVehicle == trans_rin || (PlayVehModel == 597 && PlayerInfo[playerid][AI] >= 1))
{
if(PlayerVehicle == trans_araquiel)
{
format(stringme,sizeof(stringme),"* the air around Araquiel rips open violently with dark energy as he forces his GNX drive online. *",sexverb);
}
else if(PlayerVehicle == trans_ghentriel)
{
format(stringme,sizeof(stringme),"* Ghentriel is surrounded by a soft, dark shimmer as his GNX drive comes online. *",sexverb);
}
else if(PlayerVehicle == trans_aelita)
{
format(stringme,sizeof(stringme),"* Aelita purrs softly as she spins up her GN drive, her nanotech shell glowing sexily. *",sexverb);
}
else if(PlayerVehicle == trans_stratos)
{
format(stringme,sizeof(stringme),"* Stratos shimmers with power as he brings his GN drive online, spinning it up to full. *",sexverb);
}
else
{
format(stringme,sizeof(stringme),"* %s starts the spin up sequence for the GN Drive in %s %s. *",getpName(playerid),sexverb,VehicleNames[GetVehicleModel(PlayerVehicle)-400]);
}
SendClientMessage(playerid, COLOR_MAIN, "[ AI ]-[ GN Drive Status: Online ]-[ Spin Up Cycle Complete ]");

}
else
{
format(stringme,sizeof(stringme),"* %s puts %s key in %s %s's ignition and starts the engine. *",ReturnPlayerName(playerid),sexverb,sexverb,Vehi cleNames[GetVehicleModel(PlayerVehicle)-400]);
SendClientMessage(playerid, COLOR_MAIN, "{5c99ff}[Server:] {dfebff} Car engine has been turned on!");

}
for(new l=0; l<MAX_PLAYERS; l++){
if(IsPlayerConnected(l)){
if(GetDistanceBetweenPlayers(playerid,l) <= 20 && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(l))){
SendClientMessage(l,COLOR_CYAN,stringme);
}
}
}
return 1;
}
else if(EChk == 1)
{
new PlayerVehicle = GetPlayerVehicleID(playerid);
new PlayVehModel = GetVehicleModel(PlayerVehicle);
PlayerInfo[playerid][EngineOff] = 1;
//TogglePlayerControllable(playerid, 0);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(PlayerVehicle,engine,lights,ala rm,doors,bonnet,boot,objective);
SetVehicleParamsEx(PlayerVehicle,VEHICLE_PARAMS_OF F,lights,alarm,doors,bonnet,boot,objective);

new stringme[256];
new sexverb[256];
if(PlayerInfo[playerid][pSex] == 1) { sexverb = "his"; }
else if(PlayerInfo[playerid][pSex] == 2) { sexverb = "her"; }
else { sexverb = "their"; }
if(PlayerVehicle == trans_Gea || PlayerVehicle == trans_scar || PlayerVehicle == trans_trip || PlayerVehicle == trans_86 || PlayerVehicle == trans_scourge || PlayerVehicle == trans_trinity || PlayerVehicle == trans_age || PlayerVehicle == trans_araquiel || PlayerVehicle == trans_ghentriel
|| PlayerVehicle == trans_stratos || PlayerVehicle == trans_gir || PlayerVehicle == trans_shadow || PlayerVehicle == trans_fury || PlayerVehicle == trans_ghost || PlayerVehicle == trans_simba || PlayerVehicle == trans_aelita || PlayerVehicle == trans_hunter || PlayerVehicle == trans_socks || PlayerVehicle == trans_leonidas || PlayerVehicle == trans_rin || (PlayVehModel == 597 && PlayerInfo[playerid][AI] >= 1))
{
if(PlayerVehicle == trans_araquiel)
{
format(stringme,sizeof(stringme),"* the air around Araquiel shimmers violently as he shuts his GNX drive down abruptly. *",sexverb);
}
else if(PlayerVehicle == trans_ghentriel)
{
format(stringme,sizeof(stringme),"* Ghentriel slowly shuts down his GNX drive, causing a vibration in the air around him. *",sexverb);
}
else if(PlayerVehicle == trans_aelita)
{
format(stringme,sizeof(stringme),"* Aelita purrs softly as she spins down her GN drive, her shell vibrating gently. *",sexverb);
}
else if(PlayerVehicle == trans_stratos)
{
format(stringme,sizeof(stringme),"* Stratos spins his GN drive down, shutting it off efficiently. *",sexverb);
}
else
{
format(stringme,sizeof(stringme),"* %s starts the spin down sequence for the GN Drive in %s %s. *",getpName(playerid),sexverb,VehicleNames[GetVehicleModel(PlayerVehicle)-400]);
}
SendClientMessage(playerid, COLOR_MAIN, "[ AI ]-[ GN Drive Status: Offline ]-[ Spin Down Cycle Complete ]");

}
else
{
format(stringme,sizeof(stringme),"* %s puts %s %s in park and shuts off the engine. *",ReturnPlayerName(playerid),sexverb,VehicleNa mes[GetVehicleModel(PlayerVehicle)-400]);
SendClientMessage(playerid, COLOR_MAIN, "{5c99ff}[Server:] {dfebff} Car engine has been turned off!");

}
for(new l=0; l<MAX_PLAYERS; l++){
if(IsPlayerConnected(l)){
if(GetDistanceBetweenPlayers(playerid,l) <= 20 && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(l))){
SendClientMessage(l,COLOR_CYAN,stringme);
}
}
}
return 1;

}
new stringme[256];
format(stringme,sizeof(stringme),"eng: %d lights: %d alarm: %d doors: %d bonnet: %d boot: %d obj: %d",EChk,LightsChk,AlarmChk,doorsChk,bonnetChk,boo tChk,objChk);
SendClientMessage(playerid,COLOR_CYAN,stringme);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You must be in a vehicle!");
return 1;
}
}
Reply
#2

wrong section
use pawn tags
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)