Blockland Forums > Modification Help
Client Sided Polls
(1/3) > >>
adam savage:
This code won't work. I am not good with STR functions.


--- Code: ---package AdamBotPoll
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
if(getSubStr(%msg,0,15) $= "--AdamBot_Poll")
{
%Poll = getSubStr(%msg,15,strLen(%msg));
CommandToServer('MessageSent',"There is a poll for: " @ %poll @ " say VoteYes or VoteNo for your vote. No punctuation. You have 30 seconds to vote.");
$Vote = 0;
switch$(%msg)
{
case "VoteYes": $Vote++;
case "VoteNo": $Vote--;
}
schedule(30000,0,"EndPoll()",%client);
}
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
}
};
activatePackage(AdamBotPoll);
--- End code ---
mp7964:
I'm not sure if it would work anyway. A clientsided mod would only be on your client, not anyone else's, so it would only work if you said VoteYes.
Nexus:

--- Quote from: mp7964 on January 31, 2012, 05:46:33 PM ---I'm not sure if it would work anyway. A clientsided mod would only be on your client, not anyone else's, so it would only work if you said VoteYes.

--- End quote ---

no, that isn't how client code works



I see a %msg and a %message out of nowhere.  That is probably why.
adam savage:

--- Quote from: Nexus on January 31, 2012, 07:19:57 PM ---no, that isn't how client code works



I see a %msg and a %message out of nowhere.  That is probably why.

--- End quote ---
Woops. Lol. Fixed that up. still doesn't work.


--- Quote from: mp7964 on January 31, 2012, 05:46:33 PM ---I'm not sure if it would work anyway. A clientsided mod would only be on your client, not anyone else's, so it would only work if you said VoteYes.

--- End quote ---
Brian Smith can do it. Its possible.
Ipquarx:
it is 100% possible, yet it would be much more complicated than this.
Navigation
Message Index
Next page

Go to full version