Thread: Food Bar
View Single Post
  #22  
Old 08-22-2005, 05:29 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
it works fine off line, but i'm having trouble online here is the current script i'm using:
NPC Code:
//#CLIENTSIDE
if(playerenters){
setstring client.food,100;
toweapons *Food System;
}
if(created){
showimg 2,drfoodbarback.png,15,115;
changeimgvis 2,4;
showimg 1,drfoodbarfp.png,37,121;
changeimgvis 1,4;
timeout=1;
}
if(timeout){
sleep 0;setstring client.food,#v(strtofloat(#s(client.food))-1);
changeimgpart 1,0,0,imgwidth(drfoodbarfp.png)/100*strtofloat(#s(client.food)),imgheight(drfoodba rfp.png);
if(strtofloat(#s(client.food))<2.1){
setstring client.food,2;
playerhearts=.5;
}
timeout=1;
}
if(strtofloat(#s(client.food))=5){
setplayerprop #c, I'm so hungry!;
}
if(strtofloat(#s(client.food))<1){
setstring client.food,1;
playerhearts=.5;
}
if(weaponfired){say2 You have to eat#bevery few hours.#bThe third bar at the top#bis for food.#bIf it runs out you#b will become very weak.;setplayerprop #c,#s(client.food)}

Reply With Quote