
06-06-2004, 05:47 PM
|
BEst User EVER!
|
Join Date: Apr 2004
Posts: 1,186
|
|
Help!
In the following thread it is supposed to put an npc that puts explosions based on a players power(a custom string) but it always treats it as 0, can anyone see whats wrong?
______________________________________________
if (actionserverside) {;
putnpc2 strtofloat(#p(1)),strtofloat(#p(2)),{//creates the npc;
if (created||playerenters) {setimg shadoworb.png;//sets image as shadoworb.png
this.helth=1;//sets variable this.helth as 1;
setshape 1,50,50;//sets the size;
this.helth+=strtofloat(#p(0));//Problem 1:should add the amount of variable thing, but adds 0 instead;
for (i=0;this.helth>-1;i++) {
putexplosion2 10,strtofloat(#p(0))+1//Problem 2:explosion size should be the players power +1,x,y;
sleep 1;}}
if (wa****||wasshot) {this.helth-=1;
message #v(this.helth)}
if (this.helth<=-1) {putexplosion strtofloat(#p(0)),x,y;//Problem 3: when it dies, the explosion size should be players power, but it's 0;
destroy;//destroys the npc;}
}}
//#CLIENTSIDE
if (weaponfired) {
play shock.wav;
setplayerprop#c, Mine Power: #v(strtofloat(#s(client.playerpower)));//makes player say How powerful the mine will be based on their client.playerpower string
;thing=strtofloat(#s(client.playerpower));//creates variable thing with the value of the player's power;
triggeraction 0,0,serverside,Summoner,#v(thing),#v(playerx),#v(p layery);triggers the serverside action
}
__________________________________________________ __________ |
Last edited by falco10291029; 06-06-2004 at 07:42 PM..
|
|