Weather System and Vehicle Object
#1

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?
Reply
#2

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
Reply
#3

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.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)