ok i made the changes and now it actually opens ^.^ buuuut... the only command that works is showmoney and it just says You have this much money:
please help me with this. I really want to finish this add-on(cuz lots of people want something like this and all the good ones are never released.)
newest code
function serverCmdgivemoney(%client,%reciever,%amount)
{
%cn=ClientNameFinder(%reciever);
if(%amount <= %client.money && %cn)
{
%client.money -= %amount;
%cn.money += %amount;
messageclient(%client,"","You gave up cash");
messageclient(%cn,"","you got this much money: ", %amount);
}
}
function serverCmdshowmoney(%client)
{
messageclient(%client,"","You have this much money: ", %client.money);
}
function serverCmdadmingivemoney(%client,%reciever,%amount)
{
%cn=ClientNameFinder(%reciever);
if(%client.isadmin && %cn)
{
%cn.money += %amount;
messageclient(%cn,"","you got this much money: ", %amount);
}
}
function ClientNameFinder(%name) //credit to space guy
{
if(%name $= "")
return 0;
for(%i=0;%i<ClientGroup.getCount();%i++){
%cm = ClientGroup.getObject(%i);
if(SubString(%cl.name, %name)){
if(%victim){
return 0;
} else {
%victim = %cl;
}
}
}
if(%victim){
return %victim.player;
} else {
return 0;
}
}
function SubString(%string, %substring){
for(%i=0;%i<=strlen(%string) - strlen(%substring);%i++){
if(getSubStr(%string, %i, strlen(%substring)) $= %substring)
return 1;
}
return 0;
}