[Ayuda] SetPlayerWeather... -
OTACON - 11.04.2012
Buenas a todos, Como puedo hacer para chekear un clima y si esta ese clima puesto le de tal funcion, intente poniendo SetPlayerWeather en un if peor no sirve, por ke le da el clima y yo kiero ke lo chekee solamente y le de una funcion.
PHP код:
if(SetPlayerWeather(playerid, 37))
{
//Funcion
}
Alguien sabe como puedo hacerlo?
Desde ya muchas gracias.
Respuesta: [Ayuda] SetPlayerWeather... -
TheChaoz - 11.04.2012
No hay una funcion directa para realizar lo que tu quieres. Sin embargo, puedes realizar lo siguiente:
pawn Код:
new Clima[MAX_PLAYERS];
//debajo de los includes
#define SetPlayerWeather _SetPlayerWeather
#define GetPlayerWeather(%0) Clima[(%0)]
//en el final de tu script
stock _SetPlayerWeather(playerid, weatherid)
{
Clima[playerid] = weatherid;
return SetPlayerWeather(playerid, weatherid);
}
Re: [Ayuda] SetPlayerWeather... -
santi.arg - 12.04.2012
Eso del Player Weather se podrнa utilizar para detectar cheats, cierto? Ya que el cheat te permite cambiar el tiempo.
Re: [Ayuda] SetPlayerWeather... -
Daniel-92 - 12.04.2012
Quote:
Originally Posted by santi.arg
Eso del Player Weather se podrнa utilizar para detectar cheats, cierto? Ya que el cheat te permite cambiar el tiempo.
|
no se puede, porque el cheat cambia el tiempo del lado del cliente y no del servidor.
Respuesta: [Ayuda] SetPlayerWeather... -
TheChaoz - 12.04.2012
Quote:
Originally Posted by santi.arg
Eso del Player Weather se podrнa utilizar para detectar cheats, cierto? Ya que el cheat te permite cambiar el tiempo.
|
En este caso en particular no.
Quote:
Originally Posted by Daniel-92
no se puede, porque el cheat cambia el tiempo del lado del cliente y no del servidor.
|
Justamente eso es lo que permite saber si un jugador utiliza o no cheats. Aъn asi en este caso en particular no es posible detectarlo, ya que nativamente no hay una funcion que permita obtener el clima del cliente, pero si existiese, se podria.
Respuesta: [Ayuda] SetPlayerWeather... -
OTACON - 13.04.2012
no me funciono, no lo detecta :S
Re: [Ayuda] SetPlayerWeather... -
Soi_salva - 13.04.2012
Intenta colocarlo en la funciуn
OnPlayerUpdate(playerid)
Respuesta: Re: [Ayuda] SetPlayerWeather... -
TheChaoz - 13.04.2012
Quote:
Originally Posted by bytytus
no me funciono, no lo detecta :S 
|
Como utilizas la funcion?
Notas:
- Si cambias el clima desde un script diferente al script donde esta la funcion, la misma no guardara dicho valor, para evitar esto deberas cambiar el array por pVars.
- Si cambias el clima con cheats, esta funcion no detectara el cambio.
- Si utilizas la funcion GetPlayerWeather antes de SetPlayerWeather, la misma retornara 0.
Quote:
Originally Posted by Soi_salva
Intenta colocarlo en la funciуn OnPlayerUpdate(playerid)
|
Con que fin?
Respuesta: Re: [Ayuda] SetPlayerWeather... -
OTACON - 14.04.2012
Quote:
Originally Posted by the_chaoz
Como utilizas la funcion?
Notas: - Si cambias el clima desde un script diferente al script donde esta la funcion, la misma no guardara dicho valor, para evitar esto deberas cambiar el array por pVars.
- Si cambias el clima con cheats, esta funcion no detectara el cambio.
- Si utilizas la funcion GetPlayerWeather antes de SetPlayerWeather, la misma retornara 0.
Con que fin?
|
Asi lo Utilizo:
PHP код:
#include <a_samp>
new Text:TextDraw[2];
new Clima[MAX_PLAYERS];
#define SetPlayerWeather _SetPlayerWeather
#define GetPlayerWeather(%0) Clima[(%0)]
public OnFilterScriptInit()
{
//TextDraw ...
return 1;
}
public OnPlayerSpawn(playerid)
{
if(_SetPlayerWeather(playerid, 2)) TextDrawShowForPlayer(playerid, TextDraw[1]);
return 1;
}
stock _SetPlayerWeather(playerid, weatherid)
{
Clima[playerid] = weatherid;
return SetPlayerWeather(playerid, weatherid);
}
Respuesta: [Ayuda] SetPlayerWeather... -
TheChaoz - 15.04.2012
la funcion que debes utilizar para saber el clima que le colocaste al usuario es "GetPlayerWeather", SetPlayerWeather es para setear el mismo, (y no hace falta que utilizes _SetPlayerWeather, ya que gracias a la macro, SetPlayerWeather es _SetPlayerWeather).