Quote:
Originally Posted by callimuc
If it's a weapon, than you can use this for your light:
PHP Code:
function onCreated() {
findPlayer("yourAccountHere").addWeapon(name); //add the weapon to yourself
}
//#CLIENTSIDE
function onCreated() {
this.usingLight = false; //set the flag to false; not required but I gues its better
this.image = "crystalflash.png"; //I think it will change the inventorys icon, not sure
onTimeOut(); //would use it with a onWeaonFired() toggle in a weapon if it shouldnt stay there all the time; made an example below
}
/*
function onWeaponFired() {
this.usingLight = !this.usingLight; //toggles the flag (true/false)
if (this.usingLight) onTimeOut(); //if true -> use the timeOut() function
else { //else stop the timer and hide the image
setTimer(0);
hideImg(200);
}
}
*/
function onTimeOut() {
with (findImg(200)) {
image = "crystalflash.png";
x = mouseScreenX-0.5;
y = mouseScreenY-0.5;
alpha = 0.75;
}
setTimer(0.05);
}
And this for your bomb:
PHP Code:
function onCreated() {
findPlayer("yourAccountHere").addWeapon(name); //add the weapon to yourself
}
//#CLIENTSIDE
function onCreated() {
this.usingBomb = false; //set the flag to false; not required but I gues its better
onTimeOut(); //would use it with a onWeaonFired() toggle in a weapon if it shouldnt stay there all the time; made an example below
}
/*
function onWeaponFired() {
this.usingBomb = !this.usingBomb; //toggles the flag (true/false)
if (this.usingBomb) onTimeOut(); //if true -> use the timeOut() function
else setTimer(0); //else stop the timer and hide the image
}
*/
function onTimeOut() {
putexplosion2(4, 1, mousex-1, mousey-1);
setTimer(0.05);
}
|
will other player be able to see the image as well?