SA-MP Forums Archive
help /engine[rep] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help /engine[rep] (/showthread.php?tid=314560)



help /engine[rep] - Dan_Barocu - 30.01.2012

help if i type this gamemode..the engine doesent start only the gametext appears and thats all....

Код:
 if(!strcmp(cmd, "/engine", true))
				{
				    if(IsPlayerInAnyVehicle(playerid))
			        {
						if(IsPlayerConnected(playerid))
						{
							if(!engineOn[GetPlayerVehicleID(playerid)])
							{
					            if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
								if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
								if(IsARentableVeh(idcar))
								{
								    if(HireCar[playerid] != idcar) return 1;
								}
								if(IsAHarvest(idcar)) return 1;
								if(IsADrugHarvest(idcar)) return 1;
								if(IsASweeper(idcar)) return 1;
								if(IsASalesVehicle(idcar)) return 1;

								if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
								    return SendClientMessage(playerid, COLOR_LIGHTRED,"* You cannot turn this car's engine!");

								new plname[MAX_PLAYER_NAME];
								GetPlayerName(playerid, plname, sizeof(plname));

								format(string, sizeof(string), "* %s misca din cheie ca sa porneasca masina", plname);
								ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
								if(PlayerInfo[playerid][pAdmin] < 1337 && PlayerInfo[playerid][pAdminDuty] == 1)
			                    {
			                    SetTimerEx("PornesteMasina",1300,0,"i",playerid);
								}
								else
								{
			                    SetTimerEx("PornesteMasina",1300,0,"i",playerid);
			                    }
								GameTextForPlayer(playerid, "~w~Acuma porneste masina!",1,0);
								gEngine[playerid] = 1;
								new vid = GetPlayerVehicleID(playerid);
								new engine,lights,alarm,doors,bonnet,boot,objective;
								GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
								SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
							//	engineOn[GetPlayerVehicleID(playerid)] = true;
								new y, m, d;
								new h,mi,s;
								getdate(y,m,d);
								gettime(h,mi,s);
								format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
								CommandLog(string);
								return 1;
							}
							else if(engineOn[GetPlayerVehicleID(playerid)])
				    		{
				    		    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 1;
								if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509) return 1;
								if(IsARentableVeh(idcar))
								if(IsASalesVehicle(idcar))
								{
								    if(HireCar[playerid] != idcar) return 1;
								}
								if(IsAHarvest(idcar)) return 1;
								if(IsADrugHarvest(idcar)) return 1;
								if(IsASweeper(idcar)) return 1;

								if(CanTurnEngine[playerid] != idcar && CanTurnEngine[playerid] == 9999)
									return SendClientMessage(playerid, COLOR_BLUE,"* Nu poti porni motorul la masina asta!");

								format(string, sizeof(string), "* %s opreste motorul", sendername);
								ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
								GameTextForPlayer(playerid, "~w~Motorul Oprit.",1,0);
								gEngine[playerid] = 0;
								new vid = GetPlayerVehicleID(playerid);
								new engine,lights,alarm,doors,bonnet,boot,objective;
			                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
			                    SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
								engineOn[GetPlayerVehicleID(playerid)] = false;
                                TogglePlayerControllable(playerid, 0);//// ath the dealship's in the game, you can go there and try to get a car, buy when you do /v it spawns you a car, but you can take it away, idk how you can buy it,can you fix it where they cant leave with the car, they have to buy it first?
								new y, m, d;
								new h,mi,s;
								getdate(y,m,d);
								gettime(h,mi,s);
								format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /engine",d,m,y,h,mi,s,sendername);
								CommandLog(string);
								return 1;
							}
						}
				    }
				    return 1;
				}
please help!


Re: help /engine[rep] - milanosie - 30.01.2012

change the 1 in setparas to true and 0 to false


Re: help /engine[rep] - Dan_Barocu - 30.01.2012

like this??

SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet ,boot,objective);?


Re: help /engine[rep] - DonWade - 30.01.2012

Yes , 1 for engine on 0 off


Re: help /engine[rep] - Dan_Barocu - 30.01.2012

a and if i unfreeze him then he can go!(I cant give unfreeze for 100 people..