All the props in my server cost 100$
When i add new props the pickup shows but when i try to buy the prop it says invalid command, error.
Any ideas why it failz?
Please give some more info, What script base are you using?
FBS 2.0
Quote from: Tonys on October 27, 2009, 10:10:29 PM
To make Property System work... replace commands in script with these one's
elseif ($3 == buyprop) {
if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must be logged in.
elseif (!$4) vcmp.msg $1 $2 Syntax: ! $+ $3 <Place ID>
elseif ($4 !isnum) vcmp.msg $1 $2 Invalid Place ID
elseif ($4 > $fbs.propcount) vcmp.msg $1 $2 Invalid Place ID
elseif (. isin $4) || (, isin $4) || (- isin $4) vcmp.msg $1 $2 No negative or decimal place id's
elseif ($FBS.PropPrice($4) > $FBS.actcash($1, $2)) vcmp.msg $1 $2 You do not have enough cash to buy this property
elseif ($FBS.PropDistance($2, $4) > 10) vcmp.msg $1 $2 You must be closer to the property
elseif ($FBS.PropOwner($4) != Vice City) vcmp.msg $1 $2 This property is already owned by $FBS.PropOwner($4)
elseif ($FBS.Myprops($1, $2) >= 2) vcmp.msg $1 $2 You have reached your property limit.
else {
vcmp.say $1 ** $vcmp.name($1, $2) has bought Property - $FBS.PropName($4) (ID: $4 $+ )
vcmp.msg $1 $2 Property Cost: $ $+ $FBS.PropPrice($4)
FBS.DecCash $1 $2 $FBS.PropPrice($4)
!remini -n FBS.propowners.ini OWNERS $4
!writeini -n FBS.propowners.ini OWNERS $4 $vcmp.name($1, $2)
FBS.IncMyprops $1 $2 1
}
}
elseif ($3 == sellprop) {
if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must be logged in.
elseif (!$4) vcmp.msg $1 $2 Syntax: ! $+ $3 <Place ID>
elseif ($4 !isnum) vcmp.msg $1 $2 Invalid Place ID
elseif ($4 > $fbs.propcount) vcmp.msg $1 $2 Invalid Place ID
elseif ($FBS.PropDistance($2, $4) > 10) vcmp.msg $1 $2 You must be closer to the property
elseif (. isin $4) || (, isin $4) || (- isin $4) vcmp.msg $1 $2 No negative or decimal place id's
elseif ($FBS.PropOwner($4) != $vcmp.name($1, $2)) vcmp.msg $1 $2 You do not own this property
elseif ($FBS.SpawnSetting($5) == on) vcmp.msg $1 $2 You need to turn off property spawning first
else {
vcmp.say $1 ** $vcmp.name($1, $2) has sold Property - $FBS.PropName($4) (ID: $4 $+ )
vcmp.msg $1 $2 Selling Price: $ $+ $FBS.Propprice($4)
FBS.IncCash $1 $2 $FBS.PropPrice($4)
!remini -n FBS.PropSpawn.ini SPAWN $FBS.PropShares($4)
!remini -n FBS.PropSpawn.ini STATUS $FBS.PropShares($4)
!remini -n FBS.propowners.ini OWNERS $4
!remini -n FBS.PropSpawn.ini SPAWN $vcmp.name($1, $2)
!remini -n FBS.PropSpawn.ini STATUS $vcmp.name($1, $2)
!writeini -n FBS.propowners.ini OWNERS $4 Vice City
FBS.DecMyProps $1 $2 1
}
}
elseif ($3 == addplace) {
if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must be logged in.
elseif ($FBS.Level($1, $2) < 3) vcmp.msg $1 $2 Must be level 3.
elseif (!$4) vcmp.msg $1 $2 Syntax: ! $+ $3 <Cost> <Name>
elseif (!$5) vcmp.msg $1 $2 Syntax: ! $+ $3 <Cost> <Name>
elseif ($4 !isnum) vcmp.msg $1 $2 Invalid Property Cost
elseif (. isin $4) || (, isin $4) || (- isin $4) vcmp.msg $1 $2 No negative or decimal Property Cost
else {
vcmp.msg $1 $2 Property Added - Price: $ $+ $4 - Name: $5-
!writeini -n FBS.PropCount.ini COUNT Count $calc($FBS.PropCount + 1)
!writeini -n FBS.PropOwners.ini OWNERS $FBS.PropCount Vice City
!writeini -n FBS.PropNames.ini NAMES $FBS.PropCount $5-
!writeini -n FBS.PropCosts.ini COSTS $FBS.PropCount $4
!writeini -n FBS.PropLocs.ini x $FBS.PropCount $vcmp.location($1, $2).x
!writeini -n FBS.PropLocs.ini y $FBS.PropCount $vcmp.location($1, $2).y
!writeini -n FBS.PropLocs.ini z $FBS.PropCount $vcmp.location($1, $2).z
!writeini -n FBS.PropSpawn.ini LOCATION $FBS.PropCount $calc($vcmp.location($1, $2).x - 2) $calc($vcmp.location($1, $2).y + 2) $vcmp.location($1, $2).z
FBS.LoadProps $1
}
}
Then replace all property aliases with these one..
alias FBS.PropCount !return $iif($readini(FBS.PropCount.ini,COUNT,Count),$v1,0)
alias FBS.PropPrice !return $iif($readini(FBS.PropCosts.ini,COSTS,$1),$v1,100000)
alias FBS.PropOwner !return $iif($readini(FBS.PropOwners.ini,OWNERS,$1),$v1,Vice City)
alias FBS.PropShares !return $iif($readini(FBS.PropOwners.ini,SHARES,$1),$v1,None)
alias FBS.PropName !return $iif($readini(FBS.PropNames.ini,NAMES,$1),$v1,Unknown)
alias FBS.Mypropshares !return $iif($readini(FBS.MyProps.ini,SCOUNT,$vcmp.name($1, $2)),$v1,0)
alias FBS.PropLoc !return $iif($readini(FBS.PropLocs.ini,LOCATIONS,$1),$v1,Unknown)
alias FBS.IncMyProps !writeini -n FBS.MyProps.ini COUNT $vcmp.name($1, $2) $calc($FBS.MyProps($1, $2) + $iif($3,$v1,0))
alias FBS.DecMyProps !writeini -n FBS.MyProps.ini COUNT $vcmp.name($1, $2) $calc($FBS.MyProps($1, $2) - $iif($3,$v1,0))
alias FBS.MyProps !return $iif($readini(FBS.MyProps.ini,COUNT,$vcmp.name($1, $2)),$v1,0)
alias FBS.SpawnSetting !return $iif($readini(FBS.PropSpawn.ini,STATUS,$vcmp.name($1, $2)),$v1,0ff)
alias FBS.LoadProps {
var %a = 1
set %propcount 0
while (%a <= 100) {
if (%a <= $FBS.PropCount) {
vcmp.newpickup 1 407 $readini(FBS.PropLocs.ini,x,%a) $readini(FBS.PropLocs.ini,y,%a) $readini(FBS.PropLocs.ini,z,%a)
!inc %propcount
}
!inc %a
}
timer.checkproperties 1 8 FBS.CheckCount
}
alias FBS.getmysharedprops {
var %a = 1
while (%a <= %propcount) {
if ($readini(FBS.PropOwners.ini,SHARES,%a) == $vcmp.name($1, $2)) var %b = %b $readini(FBS.PropNames.ini,NAMES,%a) $+ , ID: %a -
!inc %a
}
!return %b
}
alias FBS.CheckCount {
if (%propcount == $FBS.PropCount) {
FBS.Echo 7 $+ $chr(91) %propcount $+ / $+ $FBS.PropCount $chr(93) Properties Loaded Succesfully
}
else FBS.Echo 7Error loading Properties $chr(91) %propcount $+ / $+ $FBS.PropCount $chr(93)
}
alias FBS.PropInfo {
var %a = 1
while (%a <= 100) {
if (%a == $1) {
if ($FBS.PropOwner($1) == Vice City) {
vcmp.msg 1 $2 **** FOR SALE ****
vcmp.msg 1 $2 Property: $FBS.PropName($1) $+ ( $+ $1 $+ )
vcmp.msg 1 $2 Owner: Vice City // Cost: $ $+ $FBS.PropPrice($1)
}
elseif ($FBS.PropOwner($1) != Vice City) && ($FBS.PropShares($1) != None) {
vcmp.msg 1 $2 Property: $FBS.PropName($1) $+ ( $+ $1 $+ ) // Owner: $FBS.PropOwner($1) // Price: $ $+ $FBS.PropPrice($1)
}
elseif ($FBS.PropOwner($1) != Vice City) && ($FBS.PropShares($1) == None) {
vcmp.msg 1 $2 Property: $FBS.PropName($1) $+ ( $+ $1 $+ ) // Owner: $FBS.PropOwner($1) // Price: $ $+ $FBS.PropPrice($1)
}
else vcmp.msg 1 $2 Property info can't be found!
}
!inc %a
}
}
Oh and delete every pickup in your config file - this is a MUST.
It should now function properly only thing I haven't fixed yet is when scripts are disconnected then reconnected the Properties fuck up by moving up an ID and showing Unknown as the Name. So uh.. don't restart your server/scripts and you won't come across this problem :P
w000t
thanks a lot
it worked
that's cos you're a gypsy