14253
« on: July 10, 2011, 11:24:01 AM »
OK, I've gotten pretty far into the script, and I will post exactly what I have so far, so that people can flame at it and/or give helpful advice.
function serverCmdSacrifice(%client, %target, %number)
{
%target = FindClientByName(%target);
if(%target.bl_id == %client.bl_id)
{
messageClient(%client,"", "\c6You cannot give yourself a life, stop trying.");
return;
}
if(!isObject(%target))
{
messageClient(%client,"","\c6You cannot give a life to nobody!");
return;
}
if(%client.tdmLives <= 0 && %target.minigame.tdmLivesLimit > 0)
{
messageClient(%client,"","\c6You have no life.");
return;
}
if(%client.tdmLives <= DON'T KNOW WHAT TO DO
What I need to do there is to use %number as a variable in order to make sure that the client can give enough lives to the target.
I could continue with the script so that you only give one life to the specified target, and then run into a similar issue later.
The problem would be here
else
{
%target.tdmLives == DON'T KNOW WHAT TO DO
This is a weak point for me.
I have very little idea how to do this, but I will do some research and see if I can.
I believe there was a useful tutorial somewhere.