Weather System and Vehicle Object - 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: Weather System and Vehicle Object (
/showthread.php?tid=631680)
Weather System and Vehicle Object -
iTzMatheus - 02.04.2017
How can I do a complex Weather system?
I Want help to create a Weather System, on this system, all city will have a different weather.
Exemple: in Los Santos is Sunny, in San Fierro is raining and in Las Venturas is a dust storm.
Second question:
How can I do a police lightbar system?
I want create a command (/siren) and with this command I'll use params to create a objectid (defined by me) and next will create and edit the object to attatch on the vehicle. The player can select the perfect position on the vehicle and save the siren, the object will be created and attached to the vehicle and all will see that.
PS: I know create the command, using the params and create object. I don't know how to put the player to edit the object and next attach the object edited on the vehicle. I hope you guys help me.
How can I do?
Re: Weather System and Vehicle Object -
Toroi - 02.04.2017
As for the weather system, you could use a Streamer and put areas wherever you want the weather to change and help yourself with these functions
https://sampwiki.blast.hk/wiki/SetPlayerWeather
https://sampwiki.blast.hk/wiki/SetPlayerTime
As for the second question, you can help yourself with the following functions
https://sampwiki.blast.hk/wiki/AttachObjectToVehicle
https://sampwiki.blast.hk/wiki/EditObject
Re: Weather System and Vehicle Object -
Marricio - 03.04.2017
Found these:
IsPlayerInArea tutorial by Pghpunkid
Code by Carlton
Код:
stock IsPlayerInLosSantos(playerid) {
if(IsPlayerInArea(playerid, 2919.469, 93.423, -782.4177, -2837.724)) {
return 1;
}
return 0;
}
stock IsPlayerInSanFierro(playerid) {
if(IsPlayerInArea(playerid, -1074.365, -2931.147, 1448.057, -1237.855)) {
return 1;
}
return 0;
}
stock IsPlayerInLasVenturas(playerid) {
if(IsPlayerInArea(playerid, 2954.502, 782.4177, 2931.147, 595.5717)) {
return 1;
}
return 0;
}
Here is a very nice open-source random weather code created by Southclaw
Guide yourself with that, but please give credits accordingly.
Re: Weather System and Vehicle Object -
iTzMatheus - 03.04.2017
Thanks guys, I think the topic can now be closed.
Quote:
Found these:
IsPlayerInArea tutorial by Pghpunkid
Code by Carlton
Code:
stock IsPlayerInLosSantos(playerid) {
if(IsPlayerInArea(playerid, 2919.469, 93.423, -782.4177, -2837.724)) {
return 1;
}
return 0;
}
stock IsPlayerInSanFierro(playerid) {
if(IsPlayerInArea(playerid, -1074.365, -2931.147, 1448.057, -1237.855)) {
return 1;
}
return 0;
}
stock IsPlayerInLasVenturas(playerid) {
if(IsPlayerInArea(playerid, 2954.502, 782.4177, 2931.147, 595.5717)) {
return 1;
}
return 0;
}
Here is a very nice open-source random weather code created by Southclaw
Guide yourself with that, but please give credits accordingly.
|
Thank you, this function really help me.