Thread: Voting Npc
View Single Post
  #1  
Old 07-30-2011, 06:46 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Voting Npc

Basically iv scripted an npc which you can vote with.
its pretty simple but i thought id share it.
although it might not be such a great npc to you, to me its a milestone xD

So far all it has is /vote and /unvote functionality.
id like to make it have Votes: whatever in this.chat,
but i cant figure out how to do that without skrewing it up.
anyway enjoy the script, use it however you wish =D

PHP Code:
function onCreated(){
this.chat "0";
}
function 
onPlayerchats(){
if(
player.chat == "/vote"){
if(
clientr.voted=1){
return;
}
player.chat "Voted!";
this.chat += 1;
clientr.voted=1;
}
if(
player.chat == "/unvote"){
if(
clientr.voted=0){
return;
}
if(
clientr.voted=1){
clientr.voted=0;
player.chat "Unvoted!";
this.chat -= 1;
}
}
}
function 
onPlayertouchsme(){
say2("If You Like The New Menu Gui#bSay /vote To Vote Yes!#bYou Can Write /unvote To Cancel!");

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote