poner on y off - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (
https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: poner on y off (
/showthread.php?tid=423624)
poner on y off -
Porta0123 - 18.03.2013
hola bueno tengo esto:
pawn Код:
new Float:SuperJump[3];
GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5);
return 1;
que lo quiero para que haga un "Super salto"
bueno lo que quiero es un comando
/mjump para activar el salto
y
/mjumpo para desactivarlo
el problema es que no se como hacerlo ....
y despuйs pongo en :
OnPlayerKeyStateChange
pawn Код:
{
if(newkeys & KEY_JUMP)
{
new Float:SuperJump[3];
GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5);
return 1;
}
return 1;
}
esto estarнa bien ?
como hago para que se junte todo?
Respuesta: poner on y off -
Glimma - 18.03.2013
pawn Код:
/* ===================================================================================================== */
#include <a_samp>
#include <zcmd>
/* ===================================================================================================== */
new SaltoActivado[MAX_PLAYERS];
/* ===================================================================================================== */
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
{
if(SaltoActivado[playerid] == 1)
{
new Float:SuperJump[3];
GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5);
}
}
return 1;
}
/* ===================================================================================================== */
public OnPlayerConnect(playerid)
{
SaltoActivado[playerid] = 0; // Asigna el valor 0 a la variable al conectarse, desactivando la misma.
return 1;
}
/* ===================================================================================================== */
CMD:mjump(playerid, params[]) {
SaltoActivado[playerid] = 1;
SendClientMessage(playerid, -1, "Super salto activado, utilice /mjumpo para desactivarlo.");
return 1;
}
CMD:mjumpo(playerid, params[]) {
SaltoActivado[playerid] = 0;
SendClientMessage(playerid, -1, "Super salto desactivado, utilice /mjump para activarlo.");
return 1;
}
/* ===================================================================================================== */
OFF: їCуmo llegaste a tener 23 de reputaciуn? xd
Respuesta: poner on y off -
Porta0123 - 18.03.2013
gracias , lo provare ,
lo de "OFF" : no tengo ni idea

xD pero lo mirare xD
EDIT: Funciona ^^ Gracias