thuron Geplaatst: 17 mei 2009 Rapport Geplaatst: 17 mei 2009 (bewerkt) ik heb een jobscript gedownload waarmee je auto's kunt verkopen. maar dat werkte met checkpoints. nu wilde ik er een pickup van maken, maar dat werkt niet, en ik krijg het ook niet voor elkaar dat je de pickup alleen in een auto kunt pakken. (niet met vehiclepickup type iig) hier is het script: (sorry voor de lange post) public OnPlayerPickUpPickup(playerid, pickupid) { if (pickupid == carpickup) { if(!IsPlayerInAnyVehicle(playerid)) //If the player isnt in a vehicle { return SendClientMessage(playerid,COLOR_RED,"You must be in a vehicle!"); } new gtstr[128]; //Define gtstr if(sellon[playerid] == 0) //if he cant sell cars (sold one latley) { return GameTextForPlayer(playerid,"~R~Come back later!",3000,sold_for_gametext); //Tell him to return later } //Slamvan if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 535) //If its a Slamvan { if(sold1 == 0) //If it has not been sold { sold1 = 1; //Now its sold, so we can set the variable sellon[playerid] = 0; //We have sold a vehicle so we have to wait 5 minutes to sell again SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); //Respawn the Slamvan GivePlayerMoney(playerid,slamvan_price); //Give the player that cash SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~slamvan sold for~N~~Y~$%i~W~!",slamvan_price); //Format "gtstr" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross1 = CreateObject(3086, -1534.65, 154.05, 2.51, 0.00, 0.00, 180.00); //The cross-out object for the blackboard SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); //Camera SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); //Camera SetTimerEx("excam",reset_time*1000, false, "i", playerid); //Reset the camera and the player in whatever secondsa are defined PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); //Sound new name[16]; //Define "Name" GetPlayerName(playerid,name,16); //Get the players name and store it in the "name" variable format(string, sizeof(string), "\"%s\" has sold the Slamvan for $%i!",name,slamvan_price); //Format "string" SendClientMessageToAll(COLOR_GREEN, string); //Send "string" as a SCM } else if(sold1 == 1) //If slamvan is already sold { GameTextForPlayer(playerid,"~R~slamvan ~W~has already been sold!",3000,already_sold_gametext); //Tell them its sold } } //Blista Compact if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 496) { if(sold2 == 0) { sold2 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,blista_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~blista compact sold for~N~~Y~$%i~W~!",blista_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross2 = CreateObject(3086, -1534.45, 154.05, 2.26, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Blista Compact for $%i!",name,blista_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold2 == 1) { GameTextForPlayer(playerid,"~R~blista compact ~W~has already been sold!",3000,already_sold_gametext); } } //Stafford if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 580) { if(sold3 == 0) { sold3 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,stafford_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~stafford sold for~N~~Y~$%i~W~!",stafford_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross3 = CreateObject(3086, -1534.62, 154.05, 1.99, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Stafford for $%i!",name,stafford_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold3 == 1) { GameTextForPlayer(playerid,"~R~stafford ~W~has already been sold!",3000,already_sold_gametext); } } //Sabre if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 475) { if(sold4 == 0) { sold4 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,sabre_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~sabre sold for~N~~Y~$%i~W~!",sabre_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross4 = CreateObject(3086, -1534.73, 154.05, 1.73, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Sabre for $%i!",name,sabre_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold4 == 1) { GameTextForPlayer(playerid,"~R~Sabre ~W~has already been sold!",3000,already_sold_gametext); } } //FCR-900 if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 521) { if(sold5 == 0) { sold5 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,FCR_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~FCR-600 sold for~N~~Y~$%i~W~!",FCR_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross5 = CreateObject(3086, -1534.68, 154.05, 1.45, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the FCR-600 for $%i!",name,FCR_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold4 == 1) { GameTextForPlayer(playerid,"~R~FCR-600 ~W~has already been sold!",3000,already_sold_gametext); } } //Cheetah if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 415) { if(sold6 == 0) { sold6 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,cheetah_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~cheetah sold for~N~~Y~$%i~W~!",cheetah_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross6 = CreateObject(3086, -1532.76, 154.05, 2.55, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Cheetah for $%i!",name,cheetah_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold6 == 1) { GameTextForPlayer(playerid,"~R~Cheetah ~W~has already been sold!",3000,already_sold_gametext); } } //Rancher if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 489) { if(sold7 == 0) { sold7 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,rancher_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~rancher sold for~N~~Y~$%i~W~!",rancher_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross7 = CreateObject(3086, -1532.67, 154.04, 2.27, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("reset_time*1000",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Rancher for $%i!",name,rancher_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold7 == 1) { GameTextForPlayer(playerid,"~R~Rancher ~W~has already been sold!",3000,already_sold_gametext); } } //Stallion if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 439) { if(sold8 == 0) { sold8 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,stallion_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~stallion sold for~N~~Y~$%i~W~!",stallion_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross8 = CreateObject(3086, -1532.77, 154.04, 2.03, 0.00, 0.00, 180.00 ); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Stallion for $%i!",name,stallion_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold8 == 1) { GameTextForPlayer(playerid,"~R~Stallion ~W~has already been sold!",3000,already_sold_gametext); } } //Tanker if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 514) { if(sold9 == 0) { sold9 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,tanker_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~tanker sold for~N~~Y~$%i~W~!",tanker_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross9 = CreateObject(3086, -1532.77, 154.02, 1.75, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Tanker for $%i!",name,tanker_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold9 == 1) { GameTextForPlayer(playerid,"~R~Tanker ~W~has already been sold!",3000,already_sold_gametext); } } //Comet if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 480) { if(sold10 == 0) { sold10 = 1; sellon[playerid] = 0; SetTimerEx("exdel",wait_time*60000, false, "i", playerid); //Set the timer to be able to sell cars again new string[128]; new string2[128]; format(string2, sizeof(string2), "CAR EXPORT: You must now wait %d minutes to sell another car!",wait_time); //Format "string2" SendClientMessage(playerid, COLOR_GREEN,string2); //Send "string2" as a SendClientMessage DestroyVehicle(GetPlayerVehicleID(playerid)); GivePlayerMoney(playerid,comet_price); SetPlayerScore(playerid, GetPlayerScore(playerid) + sell_car_bonus ); format(gtstr, sizeof(gtstr), "~G~slamvan sold for~N~~Y~$%i~W~!",comet_price); //Format "string" GameTextForPlayer(playerid,gtstr,3000,sold_for_gametext); //Gametext cross10 = CreateObject(3086, -1532.86, 154.04, 1.48, 0.00, 0.00, 180.00); SetPlayerCameraPos(playerid,-1534.6313,150.5789,3.5547); SetPlayerCameraLookAt(playerid,-1534.4789,153.5749,4.6031); SetTimerEx("excam",reset_time*1000, false, "i", playerid); PlayerPlaySound(playerid,sell_car_sound,0.0,0.0,0.0); new name[16]; GetPlayerName(playerid,name,16); format(string, sizeof(string), "\"%s\" has sold the Comet for $%i!",name,comet_price); SendClientMessageToAll(COLOR_GREEN, string); } else if(sold10 == 1) { GameTextForPlayer(playerid,"~R~Comet ~W~has already been sold!",3000,already_sold_gametext); } } if(sold1 == 1 && sold2 == 1 && sold3 == 1 && sold4 == 1 && sold5 == 1 && sold6 == 1 && sold7 == 1 && sold8 == 1 && sold9 == 1 && sold10 == 1) { return reloadexport(playerid); } } return 1; } weet iemand hoe ik kan zorgen dat ie werkt, en dat je hem alleen in een auto kunt pakken? alvast bedankt Bewerkt: 17 mei 2009 door thuron Reageren
Remcconen Geplaatst: 17 mei 2009 Rapport Geplaatst: 17 mei 2009 Welk PickUp type gebruik je? En kun je de CODE-tag vervangen voor de CODEBOX-tag? Reageren
Big Boss Geplaatst: 17 mei 2009 Rapport Geplaatst: 17 mei 2009 14 Pickupable, but only when in a vehicle. Falls through objects made with CreateObject, etc.En laat ik er ook nog even bij zeggen dat AddStaticPickup (als je dat gebruikt) niet werkt in dit geval gezien je met pickupid's werkt. Reageren
thuron Geplaatst: 17 mei 2009 Auteur Rapport Geplaatst: 17 mei 2009 14 Pickupable, but only when in a vehicle. Falls through objects made with CreateObject, etc.En laat ik er ook nog even bij zeggen dat AddStaticPickup (als je dat gebruikt) niet werkt in dit geval gezien je met pickupid's werkt. Ik gebruik CreateVehicle. maar als ik nr 14 gebruik dan zie ik de pickup heel even als ik aan kom rijden, en dan gaat ie opeens weg... Reageren
Crusher!! Geplaatst: 25 mei 2009 Rapport Geplaatst: 25 mei 2009 misschien kan dit je helpen [TUT}pickups Reageren
thuron Geplaatst: 25 mei 2009 Auteur Rapport Geplaatst: 25 mei 2009 nope, maakt niet echt veel duidelijk over vehiclepickup Reageren
Recommended Posts
Een reactie plaatsen
Je kan nu een reactie plaatsen en pas achteraf registreren. Als je al lid bent, log eerst in om met je eigen account een reactie te plaatsen.